List visits
GET
/{currentTeam}/assignments
const url = 'https://api.tradeops.cc/v1/example/assignments';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.tradeops.cc/v1/example/assignments \ --header 'Authorization: Bearer <token>'Set mine=1 for the signed-in rep’s open visits, skipping closed campaigns. Results are paginated.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”currentTeam
required
string
The current team slug
Query Parameters
Section titled “Query Parameters”mine
boolean
Only the signed-in rep’s visits, leaving out closed campaigns.
status
string
For example pending, in_progress or completed.
campaign_id
integer
per_page
integer
include
Array<string>
fields[assignments]
Array<string>
fields[audit_types]
Array<string>
fields[fields]
Array<string>
fields[customers]
Array<string>
fields[customer_locations]
Array<string>
fields[submissions]
Array<string>
Responses
Section titled “Responses”Paginated set of AssignmentResource
Media typeapplication/vnd.api+json
object
data
required
Array<object>
AssignmentResourceobject
id
required
string
type
required
string
attributes
object
status
string
due_date
string | null format: date-time
completed_at
string | null format: date-time
notes
string | null
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
auditType
object
data
required
object
id
required
string
type
required
string
customer
object
data
required
object
id
required
string
type
required
string
submission
object
data
required
object
id
required
string
type
required
string
links
required
object
self
required
string
links
required
object
first
required
string | null
last
required
string | null
prev
required
string | null
next
required
string | null
meta
required
object
current_page
required
integer
from
required
integer | null
last_page
required
integer
links
required
Generated paginator links.
Array<object>
object
url
required
string | null
label
required
string
active
required
boolean
path
required
Base path for paginator generated URLs.
string | null
per_page
required
Number of items shown per page.
integer
to
required
Number of the last item in the slice.
integer | null
total
required
Total number of items being paginated.
integer
included
Array
Any of:
AuditTypeResource
object
id
required
string
type
required
string
attributes
object
name
string
slug
string
description
string | null
icon
string | null
color
string | null
status
string
settings
object
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
fields
object
data
required
Array<object>
object
id
required
string
type
required
string
links
required
object
self
required
string
FieldResource
object
id
required
string
type
required
string
attributes
object
name
string
label
string
type
string
section
string | null
options
object
validation
object
order
integer
required
boolean
score_weight
string
conditional
object | null
relationships
object
auditType
object
data
required
object
id
required
string
type
required
string
CustomerResource
object
id
required
string
type
required
string
attributes
object
name
string
slug
string
number
string | null
type
string | null
channel
string | null
region
string | null
territory
string | null
address
string | null
city
string | null
parish
string | null
latitude
string | null
longitude
string | null
contact_name
string | null
contact_phone
string | null
contact_email
string | null
metadata
object
is_active
boolean
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
locations
object
data
required
Array<object>
object
id
required
string
type
required
string
links
required
object
self
required
string
CustomerLocationResource
object
id
required
string
type
required
string
attributes
object
name
string | null
address
string | null
city
string | null
state_province
string | null
latitude
string | null
longitude
string | null
contact_name
string | null
contact_phone
string | null
contact_email
string | null
is_primary
boolean
is_active
boolean
created_at
string | null format: date-time
updated_at
string | null format: date-time
SubmissionResource
object
id
required
string
type
required
string
attributes
object
data
object
status
string
score
string | null
max_score
string | null
latitude
string | null
longitude
string | null
submitted_at
string | null format: date-time
reviewed_at
string | null format: date-time
review_notes
string | null
created_at
string | null format: date-time
updated_at
string | null format: date-time
relationships
object
auditType
object
data
required
object
id
required
string
type
required
string
customer
object
data
required
object
id
required
string
type
required
string
links
required
object
self
required
string
Example
{ "data": [ { "type": "assignments", "relationships": { "auditType": { "data": { "type": "audit_types" } }, "customer": { "data": { "type": "customers" } }, "submission": { "data": { "type": "submissions" } } } } ], "included": [ { "type": "audit_types", "relationships": { "fields": { "data": [ { "type": "fields" } ] } } } ]}Unauthenticated
Media typeapplication/json
object
message
required
Error overview.
string
Example generated
{ "message": "example"}Authorization error
Media typeapplication/json
object
message
required
Error overview.
string
Example generated
{ "message": "example"}Not found
Media typeapplication/json
object
message
required
Error overview.
string
Example generated
{ "message": "example"}Validation error
Media typeapplication/json
object
message
required
Errors overview.
string
errors
required
A detailed description of each field that failed validation.
object
key
additional properties
Array<string>
Example generated
{ "message": "example", "errors": { "additionalProperty": [ "example" ] }}Too many requests. Wait for Retry-After seconds before trying again.
Media typeapplication/json
object
message
required
string
Example generated
{ "message": "example"}Headers
Section titled “Headers”Retry-After
integer
Seconds until you can try again.