Customers
To make this request, send an authenticated request to the customers endpoint.
get
https://api.1app.online/v1/business/customers
Get a list of your customers
Take a look at how you might do this:
cURL
NodeJs
PHP - cURL
Python
1
curl --location --request GET 'https://api.1app.online/v1/business/customers' \
2
--header 'Authorization: Bearer YOUR_SECRET_KEY'
Copied!
1
var https = require('follow-redirects').https;
2
var fs = require('fs');
3
4
var options = {
5
'method': 'GET',
6
'hostname': 'api.1app.online',
7
'path': '/v1/business/customers',
8
'headers': {
9
'Authorization': 'Bearer YOUR_SECRET_KEY'
10
},
11
'maxRedirects': 20
12
};
13
14
var req = https.request(options, function (res) {
15
var chunks = [];
16
17
res.on("data", function (chunk) {
18
chunks.push(chunk);
19
});
20
21
res.on("end", function (chunk) {
22
var body = Buffer.concat(chunks);
23
console.log(body.toString());
24
});
25
26
res.on("error", function (error) {
27
console.error(error);
28
});
29
});
30
31
req.end();
Copied!
1
<?php
2
3
$curl = curl_init();
4
5
curl_setopt_array($curl, array(
6
CURLOPT_URL => 'https://api.1app.online/v1/business/customers',
7
CURLOPT_RETURNTRANSFER => true,
8
CURLOPT_ENCODING => '',
9
CURLOPT_MAXREDIRS => 10,
10
CURLOPT_TIMEOUT => 0,
11
CURLOPT_FOLLOWLOCATION => true,
12
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
13
CURLOPT_CUSTOMREQUEST => 'GET',
14
CURLOPT_HTTPHEADER => array(
15
'Authorization: Bearer YOUR_SECRET_KEY'
16
),
17
));
18
19
$response = curl_exec($curl);
20
21
curl_close($curl);
22
echo $response;
23
Copied!
1
import requests
2
3
url = "https://api.1app.online/v1/business/customers"
4
5
payload={}
6
headers = {
7
'Authorization': 'Bearer YOUR_SECRET_KEY'
8
}
9
10
response = requests.request("GET", url, headers=headers, data=payload)
11
12
print(response.text)
13
Copied!

Sample response

1
{
2
"status": true,
3
"totalcustomer": 2,
4
"message": "Customers retrieved",
5
"data": [
6
{
7
"txref": "63490b145600340",
8
"ctemail": "[email protected]",
9
"ctphone": "",
10
"statuscode": "6",
11
"customername": "John Doe"
12
},
13
{
14
"txref": "634fghj93606583",
15
"ctemail": "[email protected]",
16
"ctphone": "",
17
"statuscode": "1",
18
"customername": "Will Smith"
19
}
20
]
21
}
Copied!