Introduction
Sweep&Go - Open API description
This documentation aims to provide all the information you need to work with our API.
Base URL
https://openapi.sweepandgo.com
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by visiting your dashboard and clicking Generate API token.
Access token
API endpoints for generating and getting authentication token
Get Webhook URLs
This endpoint returns API token and urls.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/token_generate/access_tokens" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_TOKEN" \
--data "{
\"organization_id\": \"2\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/token_generate/access_tokens"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
};
let body = {
"organization_id": "2"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/token_generate/access_tokens',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_TOKEN',
],
'json' => [
'organization_id' => '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/token_generate/access_tokens'
payload = {
"organization_id": "2"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
Example response (200):
{{
"token":"************************************************************XLtm",
"webhooks_url":"https:\/\/console.log"
"enabled_events":"client:client_onboarding_onetime,client:client_recurring_employee_portal"
}}
Received response:
Request failed with error:
Generate API token
This endpoint is use for generate API token.
Example request:
curl --request POST \
"https://openapi.sweepandgo.com/api/token_generate/access_token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_TOKEN" \
--data "{
\"organization_id\": 2,
\"webhooks_url\": \"https:\\/\\/console.log\",
\"enabled_events\": \"et\",
\"description\": \"You can enter here description for endpoint\",
\"events\": [
\"qui\"
]
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/token_generate/access_token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
};
let body = {
"organization_id": 2,
"webhooks_url": "https:\/\/console.log",
"enabled_events": "et",
"description": "You can enter here description for endpoint",
"events": [
"qui"
]
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://openapi.sweepandgo.com/api/token_generate/access_token',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_TOKEN',
],
'json' => [
'organization_id' => 2,
'webhooks_url' => 'https://console.log',
'enabled_events' => 'et',
'description' => 'You can enter here description for endpoint',
'events' => [
'qui',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/token_generate/access_token'
payload = {
"organization_id": 2,
"webhooks_url": "https:\/\/console.log",
"enabled_events": "et",
"description": "You can enter here description for endpoint",
"events": [
"qui"
]
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.request('POST', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"token": "lrLxIj3PmNkSKdsFdTYYrfLFSungwVl4vXUk9alQo3Zu6cCGpslCGfHI9k2wXLtm"
}
Received response:
Request failed with error:
Get API token after generated
This endpoint returns API token and events.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/token_generate/access_token/exercitationem" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_TOKEN" \
--data "{
\"organization_id\": \"2\",
\"id\": \"1\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/token_generate/access_token/exercitationem"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
};
let body = {
"organization_id": "2",
"id": "1"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/token_generate/access_token/exercitationem',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_TOKEN',
],
'json' => [
'organization_id' => '2',
'id' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/token_generate/access_token/exercitationem'
payload = {
"organization_id": "2",
"id": "1"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"token":lrLxIj3PmNkSKdsFdTYYrfLFSungwVl4vXUk9alQo3Zu6cCGpslCGfHI9k2wXLtm"
}
Received response:
Request failed with error:
Delete API token endpoint
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/token_generate/access_token/deserunt/delete" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_TOKEN" \
--data "{
\"organization_id\": \"2\",
\"id\": \"1\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/token_generate/access_token/deserunt/delete"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
};
let body = {
"organization_id": "2",
"id": "1"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/token_generate/access_token/deserunt/delete',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_TOKEN',
],
'json' => [
'organization_id' => '2',
'id' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/token_generate/access_token/deserunt/delete'
payload = {
"organization_id": "2",
"id": "1"
}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.request('GET', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"success": "success"
}
Received response:
Request failed with error:
Clients list
API endpoints for getting clients
Get active clients
requires authentication
This endpoint retuns all active clients with pagination.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/clients/active?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/clients/active"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/clients/active',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/clients/active'
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"client": "rcl_MTPQPRUUUY7G",
"status": "active",
"type": "employee_portal",
"email": "demo@mail.com",
"first_name": "John",
"last_name": "Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
"subscription_names": "2w-3d,Deodorising",
"one_time_client": false,
"channel": "sms",
"on_the_way": true,
"completed": true,
"off_schedule": false
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Get active clients with no active subscription
requires authentication
This endpoint returns all active clients with no active subscription and pagination.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"organization_id\": \"iure\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"organization_id": "iure"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
'json' => [
'organization_id' => 'iure',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/clients/active_no_subscription'
payload = {
"organization_id": "iure"
}
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()
Example response (200):
{
"data": [
{
"client": "rcl_MTPQPRUUUY7G",
"status": "active",
"type": "employee_portal",
"email": "demo@mail.com",
"first_name": "John",
"last_name": "Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
"channel": "sms",
"on_the_way": true,
"completed": true,
"off_schedule": false,
"subscription_names": "2w-3d,Deodorising",
"one_time_client": false,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Get inactive clients
requires authentication
This endpoint returns all inactive clients for specific page of results.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/clients/inactive?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/clients/inactive"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/clients/inactive',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/clients/inactive'
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"client": "rcl_MTPQPRUUUY7G",
"status": "inactive",
"type": "employee_portal",
"email": "demo@mail.com",
"first_name": "John",
"last_name": "Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
"channel": "sms",
"on_the_way": true,
"completed": true,
"off_schedule": false,
"subscription_names": "",
"one_time_client": false,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Dispatch Board
API endpoints for getting list of jobs
Dispatch Board
requires authentication
This endpoint returns jobs list for a selected date - Dispatch Board for selected date.
If returned id is bigger than zero that means that the job is already dispatched. If itβs zero, it means that job is not dispatched.
Job status can be: pending(1), completed(2), skipped(3), missed(4), started(5) and dispatched(6)
Job type can be: custom, initial, one_time, reclean and recurring
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date?date=2022-03-28" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"date\": \"2023-01-16\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date"
);
const params = {
"date": "2022-03-28",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"date": "2023-01-16"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'date'=> '2022-03-28',
],
'json' => [
'date' => '2023-01-16',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/dispatch_board/jobs_for_date'
payload = {
"date": "2023-01-16"
}
params = {
'date': '2022-03-28',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, json=payload, params=params)
response.json()
Example response (200):
{
"data": [
{
"id": 0,
"client_location_id": 2603,
"client_id": null,
"commercial_location_id": 142,
"commercial_client_id": 84,
"pricing_plan_name": "Pet waste stations",
"commercial": 1,
"full_name": "Little Lambs Foundation for Kids",
"address": "1011 W 400 N",
"city": "Logan",
"zip": "84321",
"state_name": "Utah",
"clean_up_frequency": "1xW",
"count_cross_sells": 1,
"assigned_to_name": "Bart Cage",
"assigned_to_id": 265,
"estimate_time": "00:15",
"type": "recurring",
"end_time": null,
"start_time": null,
"status_id": 1,
"status_name": "pending",
"duration": "-",
"gate_code": null,
"gated_community": null,
"lat": 41.7389868,
"lng": -111.860119,
"number_of_dogs": null,
"safe_dogs": null,
"home_phone": "5678904567",
"cell_phone": "4567845678",
"email": "demo@demo.com"
},
{
"id": 0,
"client_location_id": 2726,
"client_id": 1580,
"commercial_location_id": null,
"commercial_client_id": null,
"pricing_plan_name": "Regular Plan",
"commercial": 0,
"full_name": "Cara Deen",
"address": "625 South 100 West",
"city": "Garland",
"zip": "84312",
"state_name": "Utah",
"clean_up_frequency": "two_times_a_week",
"count_cross_sells": 0,
"assigned_to_name": "Richard Dawson",
"assigned_to_id": 258,
"estimate_time": "00:15",
"type": "recurring",
"end_time": null,
"start_time": null,
"status_id": 1,
"status_name": "pending",
"duration": "-",
"gate_code": null,
"gated_community": null,
"lat": 41.7344582,
"lng": -112.1634671,
"number_of_dogs": 2,
"safe_dogs": "",
"home_phone": "5678904567",
"cell_phone": "4567845678",
"email": "demo@demo.com"
},
{
"id": 156608,
"client_location_id": 2325,
"type": "recurring",
"organization_id": 158,
"client_id": null,
"full_name": "Community Garden",
"address": "468 1/2 S 200 W",
"city": "Logan",
"zip": "84321",
"state_name": "Utah",
"assigned_to_id": 265,
"assigned_to_name": "Bart Cage",
"end_time": null,
"start_time": null,
"status_id": 6,
"lat": 41.7228185,
"lng": -111.8397648,
"estimate_time": "00:15",
"job_image": null,
"image_for_client": null,
"note": null,
"note_for_client": null,
"order": 1,
"arrival": 4,
"distance": "3.00",
"skip_reason_title": null,
"gate_code": null,
"count_cross_sells": 1,
"number_of_dogs": null,
"safe_dogs": null,
"gated_community": null,
"commercial": 1,
"work_areas": null,
"commercial_client_id": 76,
"commercial_location_id": 127,
"start_lat": null,
"start_lng": null,
"start_distance": null,
"clean_up_frequency": null,
"end_lat": null,
"end_lng": null,
"end_distance": null,
"skip_lat": null,
"skip_lng": null,
"skip_distance": null,
"status_name": "dispatched",
"duration": "-",
"home_phone": "5678904567",
"cell_phone": "4567845678",
"email": "demo@demo.com"
},
{
"id": 156890,
"client_location_id": 2578,
"type": "custom",
"organization_id": 158,
"client_id": 1567,
"full_name": "Carolina Wozniacki",
"address": "149 W 300 N",
"city": "Logan",
"zip": "84321",
"state_name": "Utah - UT",
"assigned_to_id": 246,
"assigned_to_name": "Ena Adamz",
"end_time": "2022-03-29 08:24:07",
"start_time": "2022-03-29 08:22:08",
"status_id": 2,
"lat": 41.7374576,
"lng": -111.8385534,
"estimate_time": "00:15",
"job_image": null,
"image_for_client": null,
"note": "",
"note_for_client": "",
"order": 5,
"arrival": null,
"distance": null,
"skip_reason_title": null,
"gate_code": null,
"count_cross_sells": 0,
"number_of_dogs": 1,
"safe_dogs": "",
"gated_community": null,
"commercial": 0,
"work_areas": null,
"commercial_client_id": null,
"commercial_location_id": null,
"start_lat": null,
"start_lng": null,
"start_distance": null,
"clean_up_frequency": "bi_weekly",
"end_lat": null,
"end_lng": null,
"end_distance": null,
"skip_lat": null,
"skip_lng": null,
"skip_distance": null,
"status_name": "completed",
"duration": "00:21",
"home_phone": "5678904567",
"cell_phone": "4567845678",
"email": "demo@demo.com"
}
]
}
}
Received response:
Request failed with error:
Leads list
API endpoints for getting leads
Get all Leads
requires authentication
This endpoint returns all leads with pagination.
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/leads/list?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/leads/list"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/leads/list',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/leads/list'
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"lead": "rld_MTPQPRUUUY7G",
"status": "active",
"type": "onboarding_form",
"email": "demo@mail.com",
"name": "John Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Get Out of area leads
requires authentication
This endpoint returns all leads who are Out of area with pagination
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/leads/out_of_service?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/leads/out_of_service"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/leads/out_of_service',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/leads/out_of_service'
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (200):
{
"data": [
{
"lead": "rld_MTPQPRUUUY7G",
"status": "lead",
"type": "out_of_area",
"email": "demo@mail.com",
"name": "John Doe",
"address": "3289 Summit Street",
"zip_code": "52801",
"home_phone": null,
"cell_phone": 2344328676,
}
],
"paginate": {
"total": 1,
"count": 1,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Onboarding new clients
API endpoints for onboarding new clients
Onboarding new client within Sweep&Go application
requires authentication
This endpoint is used for new client registration within Sweep&Go application
Example request:
curl --request PUT \
"https://openapi.sweepandgo.com/api/v1/residential/onboarding" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"zip_code\": 12110,
\"number_of_dogs\": 2,
\"last_time_yard_was_thoroughly_cleaned\": \"one_week\",
\"clean_up_frequency\": \"once_a_week\",
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"email\": \"mail@email.com\",
\"home_address\": \"1494 Ben Street\",
\"city\": \"Latham\",
\"state\": \"TX\",
\"home_phone_number\": \"7897666790\",
\"cell_phone_number\": \"9897633690\",
\"initial_cleanup_required\": true,
\"cleanup_notification_type\": \"completed,on_the_way,completed\",
\"cleanup_notification_channel\": \"sms\",
\"how_heard_about_us\": \"social_media\",
\"how_heard_answer\": \"Facebook\",
\"additional_comment\": \"Please clean my yard.\",
\"credit_card_token\": \"tok_5678967890678 or 678987678909876\",
\"name_on_card\": \"John Doe\",
\"cvv\": \"112\",
\"postal\": \"28301\",
\"expiry\": \"0924\",
\"dog_name\": [
\"Max\",
\"Oskar\"
],
\"safe_dog\": [
\"yes\",
\"no\"
],
\"dog_breed\": [
\"Poodle\",
\"Bulldog\"
],
\"dog_comment\": [
\"nice and kind\",
\"very aggressive\"
]
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/residential/onboarding"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"zip_code": 12110,
"number_of_dogs": 2,
"last_time_yard_was_thoroughly_cleaned": "one_week",
"clean_up_frequency": "once_a_week",
"first_name": "John",
"last_name": "Doe",
"email": "mail@email.com",
"home_address": "1494 Ben Street",
"city": "Latham",
"state": "TX",
"home_phone_number": "7897666790",
"cell_phone_number": "9897633690",
"initial_cleanup_required": true,
"cleanup_notification_type": "completed,on_the_way,completed",
"cleanup_notification_channel": "sms",
"how_heard_about_us": "social_media",
"how_heard_answer": "Facebook",
"additional_comment": "Please clean my yard.",
"credit_card_token": "tok_5678967890678 or 678987678909876",
"name_on_card": "John Doe",
"cvv": "112",
"postal": "28301",
"expiry": "0924",
"dog_name": [
"Max",
"Oskar"
],
"safe_dog": [
"yes",
"no"
],
"dog_breed": [
"Poodle",
"Bulldog"
],
"dog_comment": [
"nice and kind",
"very aggressive"
]
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://openapi.sweepandgo.com/api/v1/residential/onboarding',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'zip_code' => 12110,
'number_of_dogs' => 2,
'last_time_yard_was_thoroughly_cleaned' => 'one_week',
'clean_up_frequency' => 'once_a_week',
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'mail@email.com',
'home_address' => '1494 Ben Street',
'city' => 'Latham',
'state' => 'TX',
'home_phone_number' => '7897666790',
'cell_phone_number' => '9897633690',
'initial_cleanup_required' => true,
'cleanup_notification_type' => 'completed,on_the_way,completed',
'cleanup_notification_channel' => 'sms',
'how_heard_about_us' => 'social_media',
'how_heard_answer' => 'Facebook',
'additional_comment' => 'Please clean my yard.',
'credit_card_token' => 'tok_5678967890678 or 678987678909876',
'name_on_card' => 'John Doe',
'cvv' => '112',
'postal' => '28301',
'expiry' => '0924',
'dog_name' => [
'Max',
'Oskar',
],
'safe_dog' => [
'yes',
'no',
],
'dog_breed' => [
'Poodle',
'Bulldog',
],
'dog_comment' => [
'nice and kind',
'very aggressive',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/residential/onboarding'
payload = {
"zip_code": 12110,
"number_of_dogs": 2,
"last_time_yard_was_thoroughly_cleaned": "one_week",
"clean_up_frequency": "once_a_week",
"first_name": "John",
"last_name": "Doe",
"email": "mail@email.com",
"home_address": "1494 Ben Street",
"city": "Latham",
"state": "TX",
"home_phone_number": "7897666790",
"cell_phone_number": "9897633690",
"initial_cleanup_required": true,
"cleanup_notification_type": "completed,on_the_way,completed",
"cleanup_notification_channel": "sms",
"how_heard_about_us": "social_media",
"how_heard_answer": "Facebook",
"additional_comment": "Please clean my yard.",
"credit_card_token": "tok_5678967890678 or 678987678909876",
"name_on_card": "John Doe",
"cvv": "112",
"postal": "28301",
"expiry": "0924",
"dog_name": [
"Max",
"Oskar"
],
"safe_dog": [
"yes",
"no"
],
"dog_breed": [
"Poodle",
"Bulldog"
],
"dog_comment": [
"nice and kind",
"very aggressive"
]
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"success": "success"
}
Received response:
Request failed with error:
One time charges
API endpoints for one-time charges
One time payment
requires authentication
This endpoint is used for recording one time payment
Example request:
curl --request PUT \
"https://openapi.sweepandgo.com/api/v1/invoice/one_time" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"invoice_number\": \"3-3-190207-2-4\",
\"reference_number\": \"ref_8798yhjasa\",
\"amount\": \"67.98\",
\"status\": \"successful or failed\",
\"billing_address\": \"635 Go Man Go Dr\",
\"billing_city\": \"Stafford\",
\"billing_state\": \"Texas\",
\"billing_zip\": \"77477\",
\"name\": \"John Doe\",
\"email\": \"mail@mail.com\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/invoice/one_time"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"invoice_number": "3-3-190207-2-4",
"reference_number": "ref_8798yhjasa",
"amount": "67.98",
"status": "successful or failed",
"billing_address": "635 Go Man Go Dr",
"billing_city": "Stafford",
"billing_state": "Texas",
"billing_zip": "77477",
"name": "John Doe",
"email": "mail@mail.com"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://openapi.sweepandgo.com/api/v1/invoice/one_time',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'invoice_number' => '3-3-190207-2-4',
'reference_number' => 'ref_8798yhjasa',
'amount' => '67.98',
'status' => 'successful or failed',
'billing_address' => '635 Go Man Go Dr',
'billing_city' => 'Stafford',
'billing_state' => 'Texas',
'billing_zip' => '77477',
'name' => 'John Doe',
'email' => 'mail@mail.com',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/invoice/one_time'
payload = {
"invoice_number": "3-3-190207-2-4",
"reference_number": "ref_8798yhjasa",
"amount": "67.98",
"status": "successful or failed",
"billing_address": "635 Go Man Go Dr",
"billing_city": "Stafford",
"billing_state": "Texas",
"billing_zip": "77477",
"name": "John Doe",
"email": "mail@mail.com"
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (200):
{
"success": "success"
}
Received response:
Request failed with error:
Tests
API endpoints for health check of API
Health check for API
This endpoint is api status health check
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/health" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_TOKEN"
const url = new URL(
"https://openapi.sweepandgo.com/api/health"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "Bearer YOUR_TOKEN",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/health',
[
'headers' => [
'Content-Type' => 'application/json',
'Accept' => 'application/json',
'Authorization' => 'Bearer YOUR_TOKEN',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/health'
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (200):
{
"status": "OK",
"version": "v1"
}
Received response:
Request failed with error:
Test webhooks locally
requires authentication
Example request:
curl --request POST \
"https://openapi.sweepandgo.com/api/test" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/test"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://openapi.sweepandgo.com/api/test',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/test'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('POST', url, headers=headers)
response.json()
Received response:
Request failed with error:
Test API method for v1 endpoints - does not do anything, just returns what it received and triggers test webhooks.
requires authentication
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/welcome" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/welcome"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/welcome',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/welcome'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (403):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"errors": [
"API key is not valid"
]
}
Received response:
Request failed with error:
Test API method for v2 endpoints - didn't do anything, just returns what it received.
requires authentication
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v2/welcome" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v2/welcome"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v2/welcome',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v2/welcome'
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers)
response.json()
Example response (403):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"errors": [
"API key is not valid"
]
}
Received response:
Request failed with error:
Webhooks
Webhooks for organization. Here is the list of all webhooks for one organization. You may trigger it at any time to receive a list of all webhook types. Type list of webhooks:
- lead:out_of_service_area
- lead:in_service_area
- lead:delete
- client:changed_status
- client:changed_info
- client:changed_address
- client:client_onboarding_recurring
- client:client_onboarding_onetime
- client:subscription_created
- client:subscription_canceled
- client:invoice_finalized
- client:client_payment_declined
- notification:on_the_way_notification
- notification:off_schedule_notification
- notification:completed_job_notification
- notification:skipped_job_notification
- notification:client_not_assigned
- client:client_assigned
- client:subscription_cancel_requested
- client:notification_settings_changed
- client:reviews_automation
- staff:staff_clock_in
- staff:staff_forgot_to_clock_out
List of all webhooks for one organization
requires authentication
Example request:
curl --request GET \
--get "https://openapi.sweepandgo.com/api/v1/webhooks/list?page=2" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/webhooks/list"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://openapi.sweepandgo.com/api/v1/webhooks/list',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/webhooks/list'
params = {
'page': '2',
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('GET', url, headers=headers, params=params)
response.json()
Example response (403):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"errors": [
"API key is not valid"
]
}
Received response:
Request failed with error:
Retry one webhook
requires authentication
Example request:
curl --request PUT \
"https://openapi.sweepandgo.com/api/v1/webhooks/retry" \
--header "Authorization: Bearer YOUR_TOKEN" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"id\": \"e0e03073-a1a3-4f6e-82ff-81dab3772534\"
}"
const url = new URL(
"https://openapi.sweepandgo.com/api/v1/webhooks/retry"
);
const headers = {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"id": "e0e03073-a1a3-4f6e-82ff-81dab3772534"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
$client = new \GuzzleHttp\Client();
$response = $client->put(
'https://openapi.sweepandgo.com/api/v1/webhooks/retry',
[
'headers' => [
'Authorization' => 'Bearer YOUR_TOKEN',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'id' => 'e0e03073-a1a3-4f6e-82ff-81dab3772534',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
import requests
import json
url = 'https://openapi.sweepandgo.com/api/v1/webhooks/retry'
payload = {
"id": "e0e03073-a1a3-4f6e-82ff-81dab3772534"
}
headers = {
'Authorization': 'Bearer YOUR_TOKEN',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
response = requests.request('PUT', url, headers=headers, json=payload)
response.json()
Example response (403):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"errors": [
"API key is not valid"
]
}
Received response:
Request failed with error: