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://<server-ip-address>/custom_api/export_capex_details/users
				
			
Method : GET
Data ParametersRequiredValue
json or form-dataYes
data_from_timestampNo
URL Data ParametersNo
data_from_timestampYesTimestamp from which data is required (e.g., 1663999021)
current_pageYesCurrent page number (e.g., 1)
ExampleYesdata_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 :
				
					<?php
$url = "http://<server-ip-address>/custom_api/export_capex_details/users?data_from_timestamp=1663999021&current_page=1";

$headers = [
    'Authorization: Bearer <Token>',
];

$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://<server-ip-address>/custom_api/export_capex_details/users?data_from_timestamp=1663999021&current_page=1";

fetch(url, {
    method: 'GET',
    headers: {
        'Authorization': 'Bearer <Token>',
    }
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('An error occurred:', error));

				
			
curl Cammand :
				
					curl -X GET "http://<server-ip-address>/custom_api/export_capex_details/users?data_from_timestamp=1663999021&current_page=1" \
     -H "Authorization: Bearer <Token>"

				
			

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.

Note :

Share this Doc

Export Data – Export Users

Or copy link

CONTENTS