Tags
The Tags API provides a simple interface to manage tags. The API allows you to create, delete and update your tags. You can retrieve a single tag, a list of all tags, and search for tags.
JSON format
Name | Read Only | Type | Description |
---|---|---|---|
id |
true | number | Unique identifier of the tag. |
creator_id |
true | number | User ID of the tag's creator. |
name |
false | string | Name of the tag. |
resource_type |
false | string | Type name of the resource the tag is attached to. Possible values:lead ,contact ,deal |
created_at |
true | string | 的日期和时间创建UTC (ISO8601mat). |
updated_at |
true | string | Date and time of the last update in UTC (ISO8601 format). |
Retrieve all tags
GET/v2/tags
Returns all tags available to the user, according to the parameters provided.
Parameters
Name | Required | Type | In | Description |
---|---|---|---|---|
page |
false | number | Query | Page number to start from. Page numbering starts at 1, and omitting thepage parameter will return the first page. |
per_page |
false | number | Query | Number of records to return per page. The default limit is25and the maximum number that can be returned is100. |
sort_by |
false | string | Query | A field to sort by. Thedefaultorder isascending. If you want to change the sort order to descending, append:desc to the field e.g.sort_by=name:desc . Possible values:name ,updated_at ,created_at |
ids |
false | string | Query | Comma-separated list of deal tag IDs to be returned in a request. |
creator_id |
false | number | Query | User ID. Returns all tags created by that user. |
name |
false | string | Query | Name of the tag to search for. This parameter is used in a strict sense. |
resource_type |
false | string | Query | Type name of resource to search for. Possible values:lead ,contact ,deal |
Allowed for
- Agents
Using cURL
旋度-v -X GET https://api.getbase.com/v2/tags\
-H"Accept: application/json"\
-H"Authorization: Bearer$ACCESS_TOKEN"
Example response
HTTP/1.1200OK
Content-Type:application/json; charset=utf-8
Content-Language:en
{
"items":[
{
"data":{
"id":1,
"creator_id":1,
"name":"publisher",
"resource_type":"contact",
"created_at":"2014-08-27T16:32:56Z",
"updated_at":"2014-08-27T16:32:56Z"
},
"meta":{
"type":"tag"
}
},
{
"data":{
"id":2,
"creator_id":1,
"name":"marketer",
"resource_type":"contact",
"created_at":"2014-08-27T16:32:57Z",
"updated_at":"2014-08-27T16:32:57Z"
},
"meta":{
"type":"tag"
}
},
{
"data":{
"id":3,
"creator_id":1,
"name":"vendor",
"resource_type":"contact",
"created_at":"2014-08-27T16:32:58Z",
"updated_at":"2014-08-27T16:32:58Z"
},
"meta":{
"type":"tag"
}
},
{
"data":{
"id":4,
"creator_id":1,
"name":"retailer",
"resource_type":"contact",
"created_at":"2014-08-27T16:32:59Z",
"updated_at":"2014-08-27T16:32:59Z"
},
"meta":{
"type":"tag"
}
}
],
"meta":{
"type":"collection",
"count":4,
"links":{
"self":"http://api.getbase.com/v2/tags.json"
}
}
}
Create a tag
POST/v2/tags
Creates a new tag.Noticethe tag's namemustbe unique within the scope of the resource_type.
Parameters
Name | Required | Type | In | Description |
---|---|---|---|---|
name |
true | string | Body | Mustbe unique within the scope of theresource_type . |
resource_type |
true | string | Body | e.g."resource_type": "contact" |
Allowed for
- Agents
Using cURL
旋度-v -X POST https://api.getbase.com/v2/tags\
-H"Accept: application/json"\
-H"Content-Type: application/json"\
-H"Authorization: Bearer$ACCESS_TOKEN"\
-d'{
"data": {
"name": "important",
"resource_type": "contact"
},
"meta": {
"type": "tag"
}
}'
Example response
HTTP/1.1200OK
Content-Type:application/json; charset=utf-8
Content-Language:en
{
"data":{
"id":5,
"creator_id":1,
"name":"important",
"resource_type":"contact",
"created_at":"2014-08-27T16:33:00Z",
"updated_at":"2014-08-27T16:33:00Z"
},
"meta":{
"type":"tag"
}
}
Retrieve a single tag
GET/v2/tags/:id
Returns a single tag available to the user according to the unique ID provided. If the specified tag does not exist, this query will return an error.
Parameters
Name | Required | Type | In | Description |
---|---|---|---|---|
id |
true | number | Query | Unique identifier of the tag. |
Allowed for
- Agents
Using cURL
旋度-v -X GET https://api.getbase.com/v2/tags/5\
-H"Accept: application/json"\
-H"Authorization: Bearer$ACCESS_TOKEN"
Example response
HTTP/1.1200OK
Content-Type:application/json; charset=utf-8
Content-Language:en
{
"data":{
"id":5,
"creator_id":1,
"name":"important",
"resource_type":"contact",
"created_at":"2014-08-27T16:33:00Z",
"updated_at":"2014-08-27T16:33:00Z"
},
"meta":{
"type":"tag"
}
}
Update a tag
PUT/v2/tags/:id
Updates a tag's information. If the specified tag does not exist, this query will return an error.
Noticeif you want to update a tag, youmustmake sure the tag's name is unique within the scope of the specified resource.
Parameters
Name | Required | Type | In | Description |
---|---|---|---|---|
id |
true | number | Query | Unique identifier of the tag. |
name |
false | string | Body | Mustbe unique within the scope of theresource_type . |
resource_type |
false | string | Body | e.g.contact |
Allowed for
- Agents
Using cURL
旋度-v -X PUT https://api.getbase.com/v2/tags/5\
-H"Accept: application/json"\
-H"Content-Type: application/json"\
-H"Authorization: Bearer$ACCESS_TOKEN"\
-d'{
"data": {
"name": "super important"
}
}'
Example response
HTTP/1.1200OK
Content-Type:application/json; charset=utf-8
Content-Language:en
{
"data":{
"id":5,
"creator_id":1,
"name":"super important",
"resource_type":"contact",
"created_at":"2014-08-27T16:33:00Z",
"updated_at":"2014-08-27T16:33:01Z"
},
"meta":{
"type":"tag"
}
}
Delete a tag
DELETE/v2/tags/:id
Deletes an existing tag. If the specified tag is assigned to any resource, we will remove this tag from all such resources. If the specified tag does not exist, this query will return an error. This operation cannot be undone.
Parameters
Name | Required | Type | In | Description |
---|---|---|---|---|
id |
true | number | Query | Unique identifier of the tag. |
Allowed for
- Agents
Using cURL
旋度-v -X DELETE https://api.getbase.com/v2/tags/1\
-H"Authorization: Bearer$ACCESS_TOKEN"
Example response
HTTP/1.1204NoContent