Export Data – Export Users
Estimated reading: 3 minutes
Description :
Use this API to export users. This API can provide data from a specific timestamp, or if requested earlier, the next request will retrieve new or modified data since the last request. This can be used in various platforms like Web Browser, Native application in Android, iOS, etc.
URL :
http:///custom_api/export_capex_details/users
Method : GET
Data Parameters | Required | Value |
---|---|---|
json or form-data | Yes | |
data_from_timestamp | No | |
URL Data Parameters | No | |
data_from_timestamp | Yes | Timestamp from which data is required (e.g., 1663999021) |
current_page | Yes | Current page number (e.g., 1) |
Example | Yes | data_from_timestamp=1663999021¤t_page=1 |
Header Parameters:
Authorization :
Bearer <Token>
Success Response :
Code : 200
Content :
{
"code": 200,
"message": "success",
"data": {
"number_of_results": "508",
"number_of_pages": 6,
"results_per_page": 100,
"current_page": "1",
"entity_name": "users",
"resultset":[
{
"email": "test@test.com",
"name": "Adrian",
"job_title": "Regional VP",
"address": "77 5th Avenue",
"city": "New York",
"state": "New York",
"zip": "10001",
"phone": "888-1236-4281",
"business_units": [
"16844",
"16932"
]
},
{
"email": "test1@test.com",
"name": "Fred Smith",
"job_title": "Executive Vice President",
"address": "442 Saint-Gabriel",
"city": "Montreal",
"state": "Quebec",
"zip": "H2Y 2Z9",
"phone": "866-123-4281",
"business_units": [
"0"
]
}
]
}
}
Error Response :
- Code: 401 BAD REQUEST
Content :
{
"code": 401,
"message": "fail",
"data": {
"error": "Invalid API Token"
}
}
PHP Code :
/custom_api/export_capex_details/users?data_from_timestamp=1663999021¤t_page=1";
$headers = [
'Authorization: Bearer ',
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error:' . curl_error($ch);
}
curl_close($ch);
echo $response;
?>
JavaScript Code (using Fetch) :
var url = "http:///custom_api/export_capex_details/users?data_from_timestamp=1663999021¤t_page=1";
fetch(url, {
method: 'GET',
headers: {
'Authorization': 'Bearer ',
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('An error occurred:', error));
curl Cammand :
curl -X GET "http:///custom_api/export_capex_details/users?data_from_timestamp=1663999021¤t_page=1" \
-H "Authorization: Bearer "
These examples demonstrate how to make a GET request to the “Export Users” endpoint, using the authorization token and including the optional URL data parameters data_from_timestamp and current_page. Make sure to replace <server-ip-address> and <Token> with your actual server IP address and authorization token, respectively.