The Text Messages API provides a read-only access to text messages.

JSON format

Name Read Only Type Description
associated_deal_ids true array An array of ids of deals associated to the text message.
content true string Content of the text message.
created_at true string Date and time of creation in UTC (ISO8601 format).
id true number Unique identifier of the text message.
incoming true boolean Indicator of whether the text message was incoming or not.
resource_id true number Unique identifier of the resource the text message is attached to.
resource_type true string Name of the resource type the text message is attached to. Possible values:lead,contact,none
resource_phone_number true string Phone number of a resource the text message was sent to/received by.
sent_at true string Date and time of the message send time in UTC (ISO8601 format).
user_id true number Unique identifier of the user who sent/received the text message.
user_phone_number true string Phone number of the user who sent/received the text message.
updated_at true string Date and time of the last update in UTC (ISO8601 format).

Retrieve all text messages

             
GET/v2/text_messages

Returns Text Messages, according to the parameters provided.

Parameters

Name Required Type In Description
page false number Query 页码从开始。页码starts at 1 and omitting thepageparameter will return the first page. Maximum page that can be returned is1000.
per_page false number Query Number of records to return per page. The default limit is25and the maximum number that can be returned is100.
ids false string Query Comma-separated list of text message IDs to be returned in request.
resource_type false string Query Name of the type of a resource text messages are attached to. Requires alsoresource_idto be specified. Possible values:lead,contact
resource_id false number Query Unique identifier of a resource text messages are attached to. Requires also resource_type to be specified
sort_by false string Query A field to sort by. Default ordering is descending. If you want to change the sort ordering to ascending, append:ascto the field e.g.sort_by=id:desc. Possible values:id

Allowed for

  • Agents

Using cURL

             
旋度-v -X GET https://api.getbase.com/v2/text_messages\-H"Accept: application/json"\-H"Authorization: Bearer$ACCESS_TOKEN"

Example response

             
HTTP/1.1200OKContent-Type:application/json; charset=utf-8Content-Language:en{"items":[{"data":{"id":1,"user_id":1,"user_phone_number":"+44-208-1234567","content":"Schedule another call.","incoming":true,"resource_phone_number":"+44-208-1234567","resource_type":"contact","resource_id":7,"associated_deal_ids":[12],"send_at":"2016-10-02T11:08:56Z","updated_at":"2016-10-03T16:32:56Z","created_at":"2016-10-03T16:32:56Z"},"meta":{"type":"text_message"}}],"meta":{"type":"collection","count":1,"links":{"self":"http://api.getbase.com/v2/text_messages.json"}}}

Retrieve a single text message

             
GET/v2/text_messages/:id

Returns a single text message available to the user, according to the unique text message ID provided. If the specified text message does not exist, this query returns an error.

Parameters

Name Required Type In Description
id true number Query Unique identifier of the text message.

Allowed for

  • Agents

Using cURL

             
旋度-v -X GET https://api.getbase.com/v2/text_messages/1\-H"Accept: application/json"\-H"Authorization: Bearer$ACCESS_TOKEN"

Example response

             
HTTP/1.1200OKContent-Type:application/json; charset=utf-8Content-Language:en{"data":{"id":1,"user_id":1,"user_phone_number":"+44-208-1234567","content":"Schedule another call.","incoming":true,"resource_phone_number":"+44-208-1234567","resource_type":"contact","resource_id":7,"associated_deal_ids":[12],"send_at":"2016-10-02T11:08:56Z","updated_at":"2016-10-03T16:32:56Z","created_at":"2016-10-03T16:32:56Z"},"meta":{"type":"text_message"}}