Get Many Partners
Endpoint Overview
This API endpoint is designed to retrieve information about multiple partners from the Juleb ERP system. It allows you to efficiently fetch data for a group of partners in a single request, rather than making individual requests for each partner.
Partner list:
- Customer
- Vendor
- Employee
Endpoint Details
- Method: GET
- URL:
/api/v1/resources/partner
Parameters
- Path Parameters: None
- Query Parameters:
fields(string, not required): Fields to include in the response separated by comma. If not provided, all fields are returned.filter(string, not required): Apply conditions to filter the data returned.limit(integer, not required): Limit the number of records returned. Default is 10, Max is 1000.page(integer, not required): Page the records returned. Default is 1.
Response
- 200 OK: Successfully retrieved the record.
- 400 Bad Request: Invalid parameters.
- 401 Unauthorized: Authentication required.
Response Body
{
"data": [
...records
],
"meta": {
"count": integer,
"total": integer
},
"pagination": {
"previousPage": integer | null,
"currentPage": integer,
"nextPage": integer | null,
"totalPages": integer
}
}
Example
Request
- NodeJS
- curl
- python
- java
curl -X GET \
-H "accept: */*" \
-H "Authorization: Bearer $API_KEY" \
"https://$ACCOUNT_NAME.juleb.com/api/v1/resources/partner?fields=name%2Cis_company%2Cis_patient&filter=is_patient%3Dfalse&page=1&limit=10"
const axios = require('axios');
const accountName = process.env.ACCOUNT_NAME;
const apiKey = process.env.API_KEY;
axios.get(`https://${accountName}.juleb.com/api/v1/resources/partner`, {
headers: {
'accept': '*/*',
'Authorization': `Bearer ${apiKey}`
},
params: {
fields: 'name,is_company,is_patient',
filter: 'is_patient=false',
page: 1,
limit: 10
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error('Error:', error);
});
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.http.HttpResponse.BodyHandlers;
public class Main {
public static void main(String[] args) throws Exception {
String accountName = System.getenv("ACCOUNT_NAME");
String apiKey = System.getenv("API_KEY");
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(new URI("https://" + accountName + ".juleb.com/api/v1/resources/partner?fields=name,is_company,is_patient&filter=is_patient=false&page=1&limit=10"))
.header("accept", "*/*")
.header("Authorization", "Bearer " + apiKey)
.GET()
.build();
HttpResponse<String> response = client.send(request, BodyHandlers.ofString());
if (response.statusCode() == 200) {
System.out.println(response.body());
} else {
System.out.println("Error: " + response.statusCode() + ", " + response.body());
}
}
}
import os
import requests
account_name = os.getenv('ACCOUNT_NAME')
api_key = os.getenv('API_KEY')
url = f'https://{account_name}.juleb.com/api/v1/resources/partner'
headers = {
'accept': '*/*',
'Authorization': f'Bearer {api_key}'
}
params = {
'fields': 'name,is_company,is_patient',
'filter': 'is_patient=false',
'page': 1,
'limit': 10
}
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
print(response.json())
else:
print(f'Error: {response.status_code}', response.text)
Response
{
"data": [
{
"name": "Hussain",
"is_company": false,
"is_patient": false
},
{
"name": "Test Customer #2",
"is_company": true,
"is_patient": false
},
{
"name": "Mohamed",
"is_company": false,
"is_patient": false
},
{
"name": "Mohamed Youssef",
"is_company": false,
"is_patient": false
},
{
"name": "XX Beijing",
"is_company": true,
"is_patient": false
},
{
"name": "Mohammed Alshami",
"is_company": false,
"is_patient": false
},
{
"name": "Muhammad",
"is_company": false,
"is_patient": false
},
{
"name": "Mohammed Ghorab",
"is_company": false,
"is_patient": false
},
{
"name": "test11",
"is_company": false,
"is_patient": false
},
{
"name": "test loayalty points",
"is_company": false,
"is_patient": false
}
],
"meta": {
"count": 10,
"total": 140
},
"pagination": {
"previousPage": null,
"currentPage": 1,
"nextPage": 2,
"totalPages": 14
}
}