Customers
Return a list of all customers, newest to oldest.
id can optionally be used to view a single customer's information.
Parameters
id
optional - customer ID
limit
optional - limit results by this number
curl \
-X POST \
-H 'Authorization: Bearer TURBO_API_KEY' \
https://api.tur.bo/customers
<?php
/*
For this request to work please install guzzlehttp:
curl -sS https://getcomposer.org/installer | php
./composer.phar require guzzlehttp/guzzle:^7.0
*/
require 'vendor/autoload.php';
$api_url ='https://api.tur.bo';
$api_path='/customers';
$api_key ='TURBO_API_KEY';
$headers =array( 'Authorization'=>'Bearer '.$api_key );
try {
$client=new GuzzleHttp\Client( array( 'headers'=> $headers ) );
$json =$client->request(
'POST',
$api_url.$api_path
)->getBody()->getContents();
echo $json,"\n";
}
catch( Exception $e ) {
echo 'error = ',$e->getMessage(),"\n";
}
?>
#!/usr/bin/python
import requests
import json
api_url="https://api.tur.bo/customers"
result=requests.post( api_url,headers={'Authorization':'Bearer TURBO_API_KEY'} )
print( json.dumps( result.json() ) )
#!/usr/bin/env ruby
require 'uri'
require 'net/http'
require 'net/https'
api_url ="https://api.tur.bo/customers"
api_key ='TURBO_API_KEY'
uri =URI( api_url )
http =Net::HTTP.new( uri.host,uri.port )
http.use_ssl=true
data =''
headers ={
'Authorization'=>"Bearer #{api_key}"
}
result=http.post( uri.path,data,headers )
puts result.body
{
"error": false,
"msg": "OK",
"api_path": "/customers",
"total_results":1,
"limit":25,
"customers": [ {
"id": "123",
"first_name": "Bob",
"last_name": "Example",
"created":"2023-11-01 11:19:49",
"email": "[email protected]",
"phone": "(000) 000-0000"
} ]
}
| JSON response object |
| Key |
Value |
| error |
true or false depending on if an error has occurred in the API request |
| msg |
OK if all is well, otherwise will include descriptive error text |
| type |
customers |
| customer[] |
customer object |
| customer.id |
customer ID |
| customer.first_name |
first name |
| customer.last_name |
last name |
| customer.email |
email address |
| customer.phone |
phone number |
| customer.street_address |
street address |
| customer.unit |
apartment, unit, suite |
| customer.city |
city |
| customer.state |
state |
| customer.zip |
zip code |
| customer.notes |
notes about this customer |