Create Hauler
POST
/haulers
Create a new hauler profile.
Roles
Users with the following roles may access this endoint:
Admin
ClientCustomer
CrmUser
Dispatcher
Driver
Public
ThirdPartyDispatcher
ThirdPartyDriver
Breaking Changes
No breaking changes.
Request
- Sample Request
- Sample Response
POST /haulers/
Content-Type: application/json
{
"company_name": "A Test Company, Inc.",
"password": "This1s@Test!",
"recaptcha": "DummyCaptcha",
"username": "test_new_user@crosoftware.net"
}
Access-Control-Allow-Headers: Authorization, Accept, X-TENANT-ID, Content-Type
Access-Control-Allow-Methods: GET,POST
Access-Control-Allow-Origin: *
Allow: GET,POST
Content-Length: 78
Content-Type: application/json
Date: Sat, 20 Aug 2022 01:41:46 GMT
Server: WSGIServer/0.2 CPython/3.9.5
X-API-VERSION: 2019/02/08
X-REQUEST-ID: 1ec27552-ab45-4a8d-b8e1-7f101067566c
{
"id": "e6c4d756-9a6c-4eba-8071-7c047fcfd8fa",
"name": "A Test Company, Inc."
}
Path Parameters
No path parameters.
Query Parameters
No query parameters.
Request Headers
Refer to StandardPublicRequestHeadersModel for more details.
Content-Type
String, Optional
Default Value: application/json
One of the following MIME types:
- "application/json" Refer to the JSON Spec.
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).
Request Body
Refer to CreateHaulerRequestModel for more details.
company_name
String, Required
Company name (free text).
- At least 1 and no more than 64 characters.
password
String, Required
New password.
- Passwords must be at least 6 chars long, contain at least 1 capital letters, and at least 1 numbers.
recaptcha
String, Required
Recaptcha answer.
- At least 8 and no more than 512 characters.
username
String, Required
New password.
- Must be a valid email address.
Response
Response Headers
Refer to StandardResponseHeadersModel for more details.
Content-Type
String, Optional
Default Value: application/json
One of the following MIME types:
- "application/json" Refer to the JSON Spec.
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 ThirdPartyHaulerModel for more details.
id
String
Third party hauler identifier.
- Valid UUID.
name
String
Name (free text).
- At least 1 and no more than 64 characters.
Code Samples
- cURL
- Python
- CSharp 2.0
curl --request POST --include \
--header "Content-Type: application/json" \
--data '{"company_name": "A Test Company, Inc.", "password": "This1s@Test!", "recaptcha": "DummyCaptcha", "username": "test_new_user@crosoftware.net"}' \
127.0.0.1:8003/haulers
import requests, json
body = '''
{
"company_name": "A Test Company, Inc.",
"password": "This1s@Test!",
"recaptcha": "DummyCaptcha",
"username": "test_new_user@crosoftware.net"
}
'''
response = requests.post(
'http://localhost:8003/haulers',
headers={
'Content-Type': 'application/json'
},
params={
},
data=body
)
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 = "/haulers";
// Headers
client.Headers.Add("Content-Type", "application/json");
// Body
String body = "{\"company_name\": \"A Test Company, Inc.\", \"password\": \"This1s@Test!\", \"recaptcha\": \"DummyCaptcha\", \"username\": \"test_new_user@crosoftware.net\"}";
String json = client.UploadString(url, "post", body);
Console.WriteLine(json);
}
}
}