Relations
Use this endpoint to get relations from the OutSmart account. Each relation record can contain the following data:
debtor_number
Y
Unique id of the relation
name
Y
Name of the relation
contact
N
Name om the main contactperson of the relation
phone_number
N
Phone number
N
Contact email address
email_workorder
N
Email address used when sending workorder to the customer
street
Y
Relation address street name
house_number
N
Relation address house number
postal_code
Y
Relation address postal code
city
Y
Relation address city
country
N
Relation address country code
remark
N
Text field for any additional remarks on the relation
latitude
N
Relation address latitude coordinate
longitude
N
Relation address longitude coordinate
external_id
N
External id field, often used for storing id reference from external software
debtor_number_invoice
N
kvk_number
N
Chamber of commerce number
vat_number
N
VAT identification number
debtor_type
N
Indicates the relation type, for example: customer, lead etc
language
N
Language selection, value indicated with a country code. Example 'nl' for Dutch
accountmanager
N
mobile
N
Mobile phone number
status
N
active
N
Indication whether the relation is active or not. Value 0 for incactive, 1 for active
pgp_code
N
source
N
lead_phase
N
lead_score
N
lead_value
N
loss_reason
N
lead_value_recurring
N
marketing_opt_out
N
discount_sales
N
Discount percentage applied for this relation. Integer value
created_at
N
Datetime value indicating when the relation was created. Date format: YYYY-MM-DD HH🇲🇲ss
modified_at
N
Datetime value indicating the relation was last modified. Dat format: YYYY-MM-DD HH🇲🇲ss
created_by
N
Employee number of who created the relation
modified_by
N
Employee number of the last employee who modified the relation data
Freefields
Additional freefields can be added to the relation data. To include these in the results, add the URL parameter includeFreefields with value true. Freefields will only be added to the results when declared, use the Freefields endpoint to see which fields have been set. Freefields are numbered 1-50.
Filtering
This endpoint supports filtering options. Read the section on applying filters to the request here. Filters can be applied to the following field values:
name
debtor_number
contact
phone
mobile
email
werkbonmailto (filters on email_workorder)
street
streetno
zip
city
latitude
longitude
external_id
modified_at
created_at
debtor_type
active
Example with filters
In order to get specific results, multiple filters can be applied by adding multiple key[], value[], and operator[] URL parameters. For example with the request below:
{api_url}/relations/?token={client_token}&software_token={software_token}&key[]=modified_at&value[]=2022-01-01 00:00:00&operator[]=ge&key[]=active&value[]=eq&operator[]=1
This would get all relations that have been modified after new years 2022, and are set to be active. This example uses 2 filters:
modified_atvalue is checked to 'ge' (greater equals) the value 2022-01-01activevalue is check to 'eq' (equals) the value 1
Additional filters can by applied by adding more of the filter URL parameters. Do note that currently all added filters will be applied as AND, there is currently no way to check 2 filters with OR keyword. So all the applied filters will have to be checked as true on the relations returned.
Client token, unique to an Outsmart account
{{client_token}}Software token
{{software_token}}Filter parameter. Name of the field to apply filter to
Filter parameter. Search value for the filter
Filter parameter. Operator applied to the filter query
Boolean value. Determines whether freefields are included in the response. Default value is false
Response_200
No content
GET /relations/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Response_200
No content
This endpoint is used to both create and update relations to the Outsmart account. Relations will be check for existing relations on the supplied debtor_number. When an existing debtor number is supplied, data on the existing relation will be updated.
Each relation record can contain the following data:
debtor_number
Y
Unique id of the relation
name
Y
Name of the relation
contact
N
Name om the main contactperson of the relation
phone_number
N
Phone number
N
Contact email address
email_workorder
N
Email address used when sending workorder to the customer
street
Y
Relation address street name
house_number
N
Relation address house number
postal_code
Y
Relation address postal code
city
Y
Relation address city
country
N
Relation address country
remark
N
Text field for any additional remarks on the relation
latitude
N
Relation address latitude coordinate
longitude
N
Relation address longitude coordinate
external_id
N
External id field, often used for storing id reference from external software
debtor_number_invoice
N
kvk_number
N
Chamber of commerce number
vat_number
N
VAT identification number
debtor_type
N
Indicates the relation type, for example: customer, lead etc
language
N
Language selection, value indicated with a country code. Example 'nl' for Dutch
accountmanager
N
mobile
N
Mobile phone number
status
N
active
N
Indication whether the relation is active or not. Value 0 for incactive, 1 for active
pgp_code
N
source
N
lead_phase
N
lead_score
N
lead_value
N
loss_reason
N
lead_value_recurring
N
marketing_opt_out
N
discount_sales
N
Discount percentage applied for this relation. Integer value
created_at
N
Datetime value indicating when the relation was created. Date format: YYYY-MM-DD HH🇲🇲ss
modified_at
N
Datetime value indicating the relation was last modified. Dat format: YYYY-MM-DD HH🇲🇲ss
created_by
N
Employee number of who created the relation
modified_by
N
Employee number of the last employee who modified the relation data
Freefields
Additional freefields can be added to the relation data. Freefield data can be supplied bij adding a FreeFields JSON object with the relation. Freefields will only be added to the results when declared, use the Freefields endpoint to see which fields have been set. Freefields are numbered 1-50.
{{client_token}}{{software_token}}Response_200
POST /relations/ HTTP/1.1
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
Response_200
{
"code": 200,
"messages": [],
"response": 1
}Last updated
Was this helpful?
