List Current User Locations
GET
/users/current/locations
Get list of current user locations.
Roles
Users with the following roles may access this endoint:
Driver
ThirdPartyDriver
Breaking Changes
No breaking changes.
Request
- Sample Request
- Sample Response
GET /users/current/locations/
Authorization: Bearer {your-auth-token}
Content-Type: application/json
x-tenant-id: {your-tenant-id}
Access-Control-Allow-Headers: Authorization, Accept, X-TENANT-ID, Content-Type
Access-Control-Allow-Methods: GET
Access-Control-Allow-Origin: *
Allow: GET
Content-Length: 2405
Content-Type: application/json
Date: Sat, 20 Aug 2022 01:44:57 GMT
Server: WSGIServer/0.2 CPython/3.9.5
X-API-VERSION: 2019/02/08
X-REQUEST-ID: c6dc99ce-c616-4018-bf6a-dbfcc865d9a2
{
"current_limit": 100,
"current_page": 1,
"results": [
{
"address": {
"id": null,
"latitude": 48.0766427,
"line_1": "24 Lee Chatfield Way",
"line_2": null,
"line_3": null,
"line_4": null,
"locality": "Sequim",
"longitude": -123.087925,
"postcode": "98382",
"region": "Wa"
},
"allow_new_asset_numbers": false,
"asset_number_required": false,
"auto_billing_setup": false,
"auto_complete_dumps": false,
"auto_rollover_enabled": true,
"bar_code_type": "code_39",
"billing_accounts_global": false,
"contact": {
"email": "support@smsrolloffs.com",
"id": null,
"name": null,
"number": "360-555-1212"
},
"delivery_hidden": false,
"delivery_name": "LiveLoad",
"distance_factor": 0.621371,
"distance_label": "mi",
"do_share_drivers": true,
"driver_self_assignment": false,
"dropoff_hidden": false,
"dropoff_name": "Delivery",
"dtt_enabled": false,
"exchange_hidden": false,
"exchange_name": "Swap",
"id": 1,
"is_active": true,
"leed_enabled": null,
"main_inventory_name": "SMS Sequim",
"name": "SMS RollOffs",
"notify_on_acknowledged_job": false,
"notify_on_completed_job": false,
"notify_on_dispatched_job": true,
"notify_on_failed_job": true,
"pickup_hidden": false,
"pickup_name": "Pickup",
"require_reason_fail_delay": true,
"require_reference_number": false,
"require_signature": false,
"service_disclaimer": "Electronic Signature (e-Signature): You consent and agree that your use of a key pad, mouse or other device to select an item, button, icon or similar act/action while using any electronic service we offer; or in accessing or making any transactions regarding any document, agreement, acknowledgement, consent, term, disclosure, or condition constitutes your signature, acceptance and agreement as if actually signed by you in writing. Further, you agree that no certification authority or other third party verification is necessary to validate your electronic signature; and that the lack of such certification or third party verification will not in any way affect the enforceability of your signature or resulting contract. You understand and agree that your eSignature executed in conjunction with the electronic submission of your application will be legally binding and such transaction will be considered authorized by you. \n\nTest here 1\n\nNext line\n\nNext One, two, three",
"service_hidden": false,
"service_name": "Service",
"use_additional_items": true
}
],
"total_count": 1,
"total_pages": 1
}
Path Parameters
No path parameters.
Query Parameters
No query parameters.
Request Headers
Refer to StandardRequestHeadersModel for more details.
authorization
String, Required
Authorization header (bearer with access token). See the Authentication Guide to get started.
- Matches ^bearer [a-z0-9-_=]+.[a-z0-9-_=]+.?[a-z0-9-_.+/=]*$
- No longer than 256 characters.
- At least 1 characters long.
x-api-version
String, Optional
Request identifier.
- At least 1 and no more than 64 characters.
- Must be a valid API version string (2019/02/08, 2021/04/07, 2021/05/07, 2021/08/02, 2021/11/04, 2023/04/19).
x-tenant-id
Integer, Required
Tenant identifier. Contact CRO Software for more info if you don't already have this id. See list tenant ids for info on listing the tenants you have access to.
Request Body
No request body
Response
Response Headers
Refer to StandardResponseHeadersModel for more details.
x-api-version
String
Request identifier.
- At least 1 and no more than 64 characters.
- Must be a valid API version string (2019/02/08, 2021/04/07, 2021/05/07, 2021/08/02, 2021/11/04, 2023/04/19).
x-request-id
String
Request identifier.
- Valid UUID.
Response Body
Refer to LocationListModel for more details.
current_limit
Integer
Maximun number of results per page.
- Less than or equal to 1000.
- Greater than or equal to 1.
current_page
Integer
Paged results page index (starting from 1).
- Less than or equal to 10000.
- Greater than or equal to 1.
results
Array[LocationModel]
Refer to LocationModel.
total_count
Integer
Paged results total viewable records.
- Less than or equal to 100000.
- Greater than or equal to 0.
total_pages
Integer
Paged results total pages.
- Less than or equal to 1000.
- Greater than or equal to 0.
Code Samples
- cURL
- Python
- CSharp 2.0
curl --request GET --include \
--header "Authorization: Bearer {your-auth-token}" \
--header "Content-Type: application/json" \
--header "x-tenant-id: {your-tenant-id}" \
127.0.0.1:8003/users/current/locations
import requests, json
response = requests.get(
'http://localhost:8003/users/current/locations',
headers={
'Authorization': 'Bearer {your-auth-token}',
'Content-Type': 'application/json',
'x-tenant-id': '{your-tenant-id}'
},
parameters={
}
)
results = json.loads(response.text)
print(results)
using System;
using System.Net;
using System.Collections.Specialized;
namespace CROSoftware
{
public class DemoClient
{
static public void Main ()
{
WebClient client = new WebClient();
// URL
String url = "/users/current/locations";
// Headers
client.Headers.Add("Authorization", "Bearer {your-auth-token}");
client.Headers.Add("Content-Type", "application/json");
client.Headers.Add("x-tenant-id", "{your-tenant-id}");
string json = client.DownloadString(url);
Console.WriteLine(json);
}
}
}