Sources
- Source visibility
- Retrieving sources
- Submitting a source
- Updating sources
- Removing sources
- Deleting a source from a contact
- Adding or Updating a contact's source
Sources are created in their own endpoint, after which you can then connect a source to a contact.
The following fields relate to the Sources endpoint.
Field | Limits | Required? | Writeable? |
---|---|---|---|
id | No | No | |
The id of the source | |||
name | 200 characters | No | Yes |
The name of the source | |||
user_id | integer | No | No |
The id of the user who created this source |
Visibility
The sources that are returned are ones that you created.
Retrieving Sources
GET https://api-v2.liondesk.com//contact-sources
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}
If you intend to get a specific source, submit a get request for /contact-sources/id
.
Submitting a source
Submit a source to have it saved to LionDesk.
POST https://api-v2.liondesk.com//contact-sources
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}{
"name": "Zillow"
}
Updating sources
You may update a source by including the fields you want to change
PATCH https://api-v2.liondesk.com//contact-sources/149
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}{
"name": "Facebook"
}
Removing sources
To delete a source, simply submit a delete request and specify the id
of the source to delete. This will return information corresponding to the source you deleted.
DELETE https://api-v2.liondesk.com//contact-sources/149
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}{
"id": 149,
"name": "Zillow",
"user_id": 1
}
Deleting a source from a contact
To delete a source from a contact, you must submit an id
of 0 or null
.
PATCH https://api-v2.liondesk.com//contacts/1
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}{
"source_id": 0
}
Adding or Updating a contact's source
To change which source a contact has, submit a different source id
.
PATCH https://api-v2.liondesk.com//contacts/1
headers: {
Authorization: "Bearer [access token]",
Content-Type: "application/json"
}{
"source_id": 148
}
This is also how you would add a source to a contact.