Links
Standard code 200 responses from the Nutshell API include a "links" object in the top level of the request
"links": {
"accounts.creator": {
"href": "https://app.nutshell.com/rest/creators/{accounts.creator}",
"type": "creators"
},
"accounts.owner": {
"href": "https://app.nutshell.com/rest/owners/{accounts.owner}",
"type": "owners"
},
"accounts.territory": {
"href": "https://app.nutshell.com/rest/territories/{accounts.territory}",
"type": "territories"
},
"accounts.tags": {
"href": "https://app.nutshell.com/rest/tags/{accounts.tags}",
"type": "tags"
},
"accounts.files": {
"href": "https://app.nutshell.com/rest/accounts/{accounts.id}/files",
"type": "files"
},
"accounts.relatedFiles": {
"href": "https://app.nutshell.com/rest/accounts/{accounts.id}/relatedfiles",
"type": "files"
},
"accounts.followup": {
"href": "https://app.nutshell.com/rest/followups/{accounts.followup}",
"type": "followups"
},
"accounts.recurringTask": {
"href": "https://app.nutshell.com/rest/tasks/{accounts.recurringTask}",
"type": "tasks"
},
"accounts.contacts": {
"href": "https://app.nutshell.com/rest/contacts/{accounts.contacts}",
"type": "contacts"
},
"accounts.accountType": {
"href": "https://app.nutshell.com/rest/accountTypes/{accounts.accountType}",
"type": "accountTypes"
},
"accounts.industry": {
"href": "https://app.nutshell.com/rest/industries/{accounts.industry}",
"type": "industries"
}
},
This object contains additional objects keyed with the pattern "entity1.entity2". "entity1" is a type of entity directly returned from the request. The /leadsendpoint returns a list of leads, so you would see entries that look like "leads.entity2". "entity2" is a type of entity related to "entity1". For example, if a contact was attached to a lead you would find an entry labeled "leads.contacts". Inside that object is the path to make a GET request to retrieve that entity with an ID placeholder.
To know which IDs to fill in for the placeholder, the entities returned from the response have their own "links" object.
"links": {
"creator": null,
"owner": null,
"territory": null,
"tags": [],
"files": [],
"relatedFiles": [],
"followup": null,
"recurringTask": null,
"contacts": [
"3-contacts",
"55-contacts"
],
"accountType": "1-accountTypes",
"industry": null
}
Which tells you which entities specifically are related to the returned entity. So if you wanted to get all the contacts related to this account, you could make a GET request to https://app.nutshell.com/rest/contacts/3-contacts,55-contacts.
Updated 7 months ago