Collaborations
The Collaborations API provides a simple interface to manage collaborations. The API allows you to create and delete your collaborations. You can retrieve a single collaboration as well as list of all collaborations.
You can assign as many collaborations as you want to any of the resources listed below:
JSON format
| Name | Type | Read-only | Description |
|---|---|---|---|
id | number | true | Unique identifier of the collaboration. |
creator_id | number | true | Unique identifier of the user that created the collaboration. |
resource_type | string | false | Type name of the resource the collaboration is attached to. Possible values: lead, contact, sales_account, deal |
resource_id | number | false | Unique identifier of the resource the collaboration is attached to. |
collaborator_id | number | false | Unique identifier of the collaborator. |
created_at | string | true | Date and time of creation in UTC (ISO8601 format). |
updated_at | string | true | Date and time of the last update in UTC (ISO8601 format). |
Retrieve all Collaborations
GET /v2/collaborations
Returns all collaborations available to the user, according to the parameters provided.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
page | number | Query | false | Page number to start from. Page numbering starts at 1, and omitting the page parameter will return the first page. e.g. ?page=2 |
per_page | number | Query | false | Number of records to return per page. Default limit is 25 and the maximum number that can be returned is 100. e.g. ?per_page=20 |
ids | number | Query | false | Comma-separated list of call IDs to be returned in request. e.g. ?ids=1,2,3 |
includes | string | Query | false | Comma-separated list of one or more resources related to the collaboration. Not supported at the moment. |
sort_by | string | Query | false | A field to sort by. Default ordering is ascending. If you want to change the sort ordering to descending, append :desc to the field e.g. sort_by=resource_type:desc. |
creator_id | number | Query | false | Unique identifier of the user. Returns all collaborations created by the user. e.g. ?creator_id=1 |
resource_id | number | Query | false | Unique identifier of the resource calls are attached to. e.g. ?resource_id=7 |
resource_type | number | Query | false | Name of the type of resource calls are attached to. Possible valies: lead, contact, deal, sales_account. e.g. ?resource_type=lead |
Allowed for
- Agents
Using curl
curl -v -X GET https://api.getbase.com/v2/collaborations?resource_type=deals \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"
Example Response
HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Language: en{"items": [{"data": {"id": 1,"creator_id": 1,"resource_type": "lead","resource_id": 1,"collaborator_id": 2,"created_at": "2014-08-27T16:32:56Z","updated_at": "2014-08-27T17:32:56Z"},"meta": {"type": "collaboration"}}],"meta": {"type": "collection","count": 1,"links": {"self": "http://api.getbase.com/v2/collaborations.json"}}}
Create a Collaboration
POST /v2/collaborations
Create a new collaboration and associate it with one of the resources listed below:
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
collaborator_id | number | Body | true | e.g. "resource_type": "lead" |
resource_id | number | Body | true | e.g. "resource_id": "1" |
resource_type | number | Body | true | e.g. "collaborator_id": "2" |
Allowed for
- Agents
Using cURL
curl -v -X POST https://api.getbase.com/v2/collaborations \-H "Accept: application/json" \-H "Content-Type: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN" \-d '{"data": {"resource_type": "lead","resource_id": 1,"collaborator_id": 2},"meta": {"type": "collaboration"}}'
Example response
HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Language: en{"data": {"id": 1,"creator_id": 1,"resource_type": "lead","resource_id": 1,"collaborator_id": 2,"created_at": "2014-08-27T16:32:56Z","updated_at": "2014-08-27T17:32:56Z"},"meta": {"type": "collaboration"}}
Retrieve a single Collaboration
GET /v2/collaborations/:id
Returns a single collaboration available to the user, according to the unique collaboration ID provided. If the collaboration ID does not exist, this request will return an error.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id | number | Query | true | Unique identifier of the collaboration. |
Allowed for
- Agents
Using cURL
curl -v -X GET https://api.getbase.com/v2/collaborations/1 \-H "Accept: application/json" \-H "Authorization: Bearer $ACCESS_TOKEN"
Example Response
HTTP/1.1 200 OKContent-Type: application/json; charset=utf-8Content-Language: en{"data": {"id": 1,"creator_id": 1,"resource_type": "lead","resource_id": 1,"collaborator_id": 2,"created_at": "2014-08-27T16:32:56Z","updated_at": "2014-08-27T17:32:56Z"},"meta": {"type": "collaboration"}}
Delete a Collaboration
DELETE /v2/collaborations/:id
Delete an existing collaboration. If the collaboration ID does not exist, this request will return an error. This operation cannot be undone.
Parameters
| Name | Type | In | Required | Description |
|---|---|---|---|---|
id | number | Query | true | Unique identifier of the collaboration. |
Using cURL
curl -v -X DELETE https://api.getbase.com/v2/collaborations/1 \-H "Authorization: Bearer $ACCESS_TOKEN"
Example Response
HTTP/1.1 204 No Content