Avochato API


Welcome!

If anything isn’t working as documented, please message Avochato Support @ 415-214-8977.

To use the Avochato API, you will need a pair of Auth ID and Secret tokens. Tokens are account-specific and are bound to your specific User, so a pair of tokens must be generated per account. To generate a new set of tokens, please log into www.avochato.com and go to Settings > Api Access.

To get started, here are some common places you may want to check out:

  • Contacts, which represent a unique external phone number that is interacting with your Avochato number
  • Tickets, which represent a conversation between an Account and a Contact
  • Messages, which represent the messages sent and received by your Avochato number
  • Broadcasts, which let you create and schedule messages to an audience of Contacts

Accounts

Fetch Accounts

Using your auth id + secret you can fetch Accounts by subdomains

Endpoint

GET /v1/accounts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Account subdomains to fetch
page Page to request

Request

Route

GET /v1/accounts/test-account%2Caccount_6?auth_id=z1N8xyAb37&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=z1N8xyAb37
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts/test-account%2Caccount_6?auth_id=z1N8xyAb37&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: b47a41c6-ce9d-43bb-bfe8-df28264b5c88
X-Runtime: 0.018651
Content-Length: 293

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "Dr8GnQYJPl",
        "subdomain": "account_6",
        "name": "Account 6",
        "phone": null,
        "created_at": "2019-10-17T15:42:54.993-07:00"
      },
      {
        "id": "DR8zMnZJA2",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2019-10-17T15:42:55.007-07:00"
      }
    ]
  },
  "page": 1
}

List Accounts

Using your auth id + secret you can list all your Accounts

Endpoint

GET /v1/accounts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page to request

Request

Route

GET /v1/accounts?auth_id=v7Mb6xOJER&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=v7Mb6xOJER
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/accounts?auth_id=v7Mb6xOJER&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 4fb15f3b-9a46-415c-90ec-e11816f43520
X-Runtime: 0.052261
Content-Length: 293

Body

{
  "status": 200,
  "data": {
    "accounts": [
      {
        "id": "7Mb6WzQ9ER",
        "subdomain": "account_5",
        "name": "Account 5",
        "phone": null,
        "created_at": "2019-10-17T15:42:54.870-07:00"
      },
      {
        "id": "1N8xDgp837",
        "subdomain": "test-account",
        "name": "Test Account",
        "phone": null,
        "created_at": "2019-10-17T15:42:54.889-07:00"
      }
    ]
  },
  "page": 1
}

Broadcasts

Create Broadcast

Using your auth id + secret you can setup a broadcast

Endpoint

POST /v1/broadcasts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
message required Text to send in Broadcasts
media_url Url of media to send in MMS (500kb limit)
name Name of the broadcast to set
via_tags Comma-separated list of contact tags to add to broadcast
via_contact_ids Comma-separated list of contact ids to add to broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to broadcast
via_field[field] String, either name ,phone ,phone_formatted ,email ,company ,street ,city ,state ,country ,zip ,priority ,opted_out, OR Custom Variable name
via_field[value] String, match all contacts with a given field which matches this value exactly

Request

Route

POST /v1/broadcasts

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "wEG8jWAbQl",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "message": "new test message",
  "media_url": "https://somesite.com/pretty.jpg",
  "name": "My New Broadcast",
  "via_tags": "tag1,tag2",
  "via_contact_ids": "webome5JXm",
  "via_phone_numbers": "5105551234,4155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

cURL

curl "https://www.avochato.com/v1/broadcasts" -d '{"auth_id":"wEG8jWAbQl","auth_secret":"YYYYYYYYYYYYYYYYYYYY","message":"new test message","media_url":"https://somesite.com/pretty.jpg","name":"My New Broadcast","via_tags":"tag1,tag2","via_contact_ids":"webome5JXm","via_phone_numbers":"5105551234,4155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 7d3e6fe0-a481-4308-980f-383f2b515965
X-Runtime: 0.107326
Content-Length: 306

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "WAnJQWLby1",
      "name": "My New Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty.jpg",
      "status": "initialized",
      "contacts_count": 0,
      "user": {
        "email": "person_19@example.com",
        "id": "3y83WzA8VN",
        "name": "Person 21"
      },
      "pending_contacts_count": null
    }
  }
}

Fetch Broadcasts

Using your auth id + secret you can fetch broadcasts based on their ids

Endpoint

GET /v1/broadcasts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Broadcast ids to fetch
page Page number to request

Request

Route

GET /v1/broadcasts/qQR91voJge%2C0N6bwNO8DM?auth_id=v5D9RmqbVA&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=v5D9RmqbVA
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/broadcasts/qQR91voJge%2C0N6bwNO8DM?auth_id=v5D9RmqbVA&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: c55f2a6c-e1a7-42ea-8572-61e9ddbfacb9
X-Runtime: 0.026882
Content-Length: 399

Body

{
  "status": 200,
  "data": {
    "broadcasts": [
      {
        "id": "qQR91voJge",
        "name": null,
        "message": "7",
        "media_url": null,
        "status": "initialized",
        "contacts_count": 1,
        "user": {
          "email": "person_21@example.com",
          "id": "lYJp6Yobmw",
          "name": "Person 23"
        }
      },
      {
        "id": "0N6bwNO8DM",
        "name": null,
        "message": "8",
        "media_url": null,
        "status": "queued",
        "contacts_count": 0,
        "user": {
          "email": "person_21@example.com",
          "id": "lYJp6Yobmw",
          "name": "Person 23"
        }
      }
    ]
  }
}

Publish Broadcast

Using your auth id + secret you can publish your broadcast

Endpoint

POST /v1/broadcasts/:id/publish

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
schedule_for Unix timestamp, Ensure delivery at this time
asap Boolean, Ignore schedule_for and schedule ASAP

Request

Route

POST /v1/broadcasts/2jRbkve81P/publish

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "43y834pbVN",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "schedule_for": 1571316177.871795,
  "asap": true
}

cURL

curl "https://www.avochato.com/v1/broadcasts/2jRbkve81P/publish" -d '{"auth_id":"43y834pbVN","auth_secret":"YYYYYYYYYYYYYYYYYYYY","schedule_for":1571316177.871795,"asap":true}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 6b8cdc16-6807-4c1a-a3af-7c4aad982a93
X-Runtime: 0.121759
Content-Length: 213

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "2jRbkve81P",
      "name": null,
      "message": "1",
      "media_url": null,
      "status": "queued",
      "contacts_count": 1,
      "user": {
        "email": "person_18@example.com",
        "id": "oWbq7vXJqn",
        "name": "Person 20"
      }
    }
  }
}

Update Broadcast

Using your auth id + secret you can add more contacts or update your broadcast

Endpoint

POST /v1/broadcasts/:id

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
message Text to send in Broadcasts
media_url Url of media to send in MMS (500kb limit)
name Name of the Broadcast to set
via_tags Comma-separated list of contact tags to add to broadcast
via_contact_ids Comma-separated list of contact ids to add to broadcast
via_phone_numbers Comma-separated list of phone_numbers to add to broadcast
via_field[field] String, [:name, :phone, :phone_formatted, :email, :company, :street, :city, :state, :country, :zip, :priority, :opted_out], OR Custom Variable name
via_field[value] String, match all contacts with a given field which matches this value exactly

Request

Route

POST /v1/broadcasts/0nMJLeN8vZ

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "xlYJpm68mw",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "message": "new test message",
  "media_url": "https://somesite.com/pretty2.jpg",
  "name": "My Other Broadcast",
  "via_tags": "tag2,tag3",
  "via_contact_ids": "3y83Wjp8VN",
  "via_phone_numbers": "+15105551234,+14155551234",
  "via_field[field]": "email",
  "via_field[value]": "bob@mctest.com"
}

cURL

curl "https://www.avochato.com/v1/broadcasts/0nMJLeN8vZ" -d '{"auth_id":"xlYJpm68mw","auth_secret":"YYYYYYYYYYYYYYYYYYYY","message":"new test message","media_url":"https://somesite.com/pretty2.jpg","name":"My Other Broadcast","via_tags":"tag2,tag3","via_contact_ids":"3y83Wjp8VN","via_phone_numbers":"+15105551234,+14155551234","via_field[field]":"email","via_field[value]":"bob@mctest.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: bd2e215c-67e8-42ba-bc82-59745e387286
X-Runtime: 0.070652
Content-Length: 306

Body

{
  "status": 200,
  "data": {
    "broadcast": {
      "id": "0nMJLeN8vZ",
      "name": "My Other Broadcast",
      "message": "new test message",
      "media_url": "https://somesite.com/pretty2.jpg",
      "status": "initialized",
      "contacts_count": 1,
      "user": {
        "email": "person_20@example.com",
        "id": "EG8jnwO8Ql",
        "name": "Person 22"
      },
      "pending_contacts_count": 3
    }
  }
}

CallTokens

Create Call Token

Using your auth id + secret you can create a token to make a call

Endpoint

POST /v1/calls

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field

Request

Route

POST /v1/calls

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "AEgb50o8ej",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY"
}

cURL

curl "https://www.avochato.com/v1/calls" -d '{"auth_id":"AEgb50o8ej","auth_secret":"YYYYYYYYYYYYYYYYYYYY"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 339d199b-811d-4e82-b785-12d375530e0b
X-Runtime: 0.041799
Content-Length: 324

Body

{
  "status": 200,
  "data": {
    "call_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzY29wZSI6InNjb3BlOmNsaWVudDpvdXRnb2luZz9hcHBTaWQ9bm90cmVhbCBzY29wZTpjbGllbnQ6aW5jb21pbmc_Y2xpZW50TmFtZT13ZWJvYTFXSlhtIiwiaXNzIjoidHdpbGlvX2FjY291bnRfc2lkIiwibmJmIjoxNTcxMzUyMTc2LCJleHAiOjE1NzE0Mzg1NzZ9.QxdyN27JiVgb4UuU0Si0XwoYeiMKpYdO-oGc5AaYlgY"
  }
}

Contacts

Fetch Contacts

Using your auth id + secret you can fetch Contacts by ids

Endpoint

GET /v1/contacts/:ids

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to fetch
page Page to request

Request

Route

GET /v1/contacts/vnJAvKB8AD%2Cxk9EzKwJRK?auth_id=PxB9NND9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=PxB9NND9YO
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts/vnJAvKB8AD%2Cxk9EzKwJRK?auth_id=PxB9NND9YO&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: a38d70ad-f727-44b8-9529-a8ba0c99d9d8
X-Runtime: 0.022956
Content-Length: 589

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "xk9EzKwJRK",
        "name": "Bob McTest",
        "phone": "+15551234567",
        "email": "bob@mctest.com",
        "street": null,
        "city": "Los Angeles",
        "state": "CA",
        "zip": "99999",
        "notes": null,
        "company": "McTest Inc",
        "other_phone": null,
        "created_at": 1571351581.65797,
        "tags": [
          "important"
        ],
        "opted_out": false
      },
      {
        "id": "vnJAvKB8AD",
        "name": "Other Contact",
        "phone": "+15551234568",
        "email": "bob@contact.com",
        "street": null,
        "city": "San Francisco",
        "state": "CA",
        "zip": "88888",
        "notes": null,
        "company": "Contact Inc",
        "other_phone": null,
        "created_at": 1571352181.66521,
        "tags": [

        ],
        "opted_out": false
      }
    ]
  },
  "page": 1
}

Search Contacts

Using your auth id + secret you can search for matching Contacts based on a query

Endpoint

GET /v1/contacts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String to search Contacts with (default: iterate through all Contacts)
created_at[from] Select Contacts created after this unixtime
created_at[to] Select Contacts created before this unixtime (default: now)
page Page to request

Request

Route

GET /v1/contacts?auth_id=enL8aYY87N&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1571352121.50971&created_at%5Bto%5D=1571352241.5097668&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=enL8aYY87N
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=name:Bob OR 'San Fran'
created_at={"from"=>"1571352121.50971", "to"=>"1571352241.5097668"}
page=1

cURL

curl -g "https://www.avochato.com/v1/contacts?auth_id=enL8aYY87N&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=name%3ABob+OR+%27San+Fran%27&created_at%5Bfrom%5D=1571352121.50971&created_at%5Bto%5D=1571352241.5097668&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: d071a6af-7a4e-4b57-878e-6c725f414812
X-Runtime: 0.030904
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "contacts": [
      {
        "id": "5V9VANyblr",
        "name": "Other Contact",
        "phone": "+15551234568",
        "email": "bob@contact.com",
        "street": null,
        "city": "San Francisco",
        "state": "CA",
        "zip": "88888",
        "notes": null,
        "company": "Contact Inc",
        "other_phone": null,
        "created_at": 1571352181.49126,
        "tags": [

        ],
        "opted_out": false
      }
    ]
  },
  "page": 1
}

Update Contact

Using your auth id + secret you can create or update a Contact based on their phone number

Endpoint

POST /v1/contacts

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
contacts required List of Contacts
contacts[n][phone] required Phone number of Contact
contacts[n][name] Name of the Contact
contacts[n][email] Email for the Contact
contacts[n][other_phone] Other phone for the Contact
contacts[n][company] Company for the Contact
contacts[n][street] Street for the Contact
contacts[n][city] City for the Contact
contacts[n][state] State for the Contact
contacts[n][zip] Zip Code for the Contact
contacts[n][country] Country for the Contact
contacts[n][opted_out] Opted-out status of the Contact
contacts[n][visible] Visibility status of the Contact
contacts[n][custom_variable_name] Custom variable to set for the Contact
contacts[n][tags] CSV of tags to apply to the Contact

Request

Route

POST /v1/contacts

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "k5V9V4r8lr",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "contacts": [
    {
      "phone": "+14155553333",
      "name": "Bob McTest",
      "email": "contact@example.com",
      "company": "Example Inc.",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "country": "USA",
      "opted_out": false,
      "visible": true,
      "custom_variable_name": "value to set custom variable",
      "tags": "red,green,blue"
    }
  ]
}

cURL

curl "https://www.avochato.com/v1/contacts" -d '{"auth_id":"k5V9V4r8lr","auth_secret":"YYYYYYYYYYYYYYYYYYYY","contacts":[{"phone":"+14155553333","name":"Bob McTest","email":"contact@example.com","company":"Example Inc.","street":"123 Main St.","city":"SF","state":"CA","zip":"99999","country":"USA","opted_out":false,"visible":true,"custom_variable_name":"value to set custom variable","tags":"red,green,blue"}]}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: b5aab5d1-b49c-43a7-a382-e158365091dd
X-Runtime: 0.382931
Content-Length: 378

Body

{
  "status": 200,
  "data": {
    "contact": {
      "id": "EnJdnWkbRm",
      "name": "Bob McTest",
      "phone": "+14155553333",
      "email": "contact@example.com",
      "street": "123 Main St.",
      "city": "SF",
      "state": "CA",
      "zip": "99999",
      "notes": null,
      "company": "Example Inc.",
      "other_phone": null,
      "created_at": 1572509114.08117,
      "tags": [
        "red",
        "green",
        "blue"
      ],
      "opted_out": false,
      "custom_variable_name": "value to set custom variable"
    }
  }
}

Events

Add Event (Contact id)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the Contact id

Endpoint

POST /v1/contacts/:id/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Contact id to add an event to
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/contacts/xk9EzMwJRK/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "1LxJDpgJn2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "type": "sale",
  "context": "Wanted a new watch ($99.99) with no warranty",
  "revenue": 99.99
}

cURL

curl "https://www.avochato.com/v1/contacts/xk9EzMwJRK/events" -d '{"auth_id":"1LxJDpgJn2","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted a new watch ($99.99) with no warranty","revenue":99.99}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 129f58a4-a02d-41e7-8de9-e3806b486e6c
X-Runtime: 0.291319
Content-Length: 302

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "vnJAvz18AD",
      "account_id": "LxJDva5bn2",
      "ticket_id": "EG8jnAO8Ql",
      "contact_id": "xk9EzMwJRK",
      "type": "sale",
      "context": "Wanted a new watch ($99.99) with no warranty",
      "revenue": 99.99,
      "element_id": "AwebYoJaEr",
      "element_type": "CustomEvent",
      "sent_at": 1571352173.81823
    }
  }
}

Add Event (Phone)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the phone number

Endpoint

POST /v1/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "YOobKRN87E",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "type": "sale",
  "context": "Bought an avocado ($2) and was interested in a subscription",
  "revenue": 2.0
}

cURL

curl "https://www.avochato.com/v1/events" -d '{"auth_id":"YOobKRN87E","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","type":"sale","context":"Bought an avocado ($2) and was interested in a subscription","revenue":2.0}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 9076befe-48f2-4dc6-a918-e0ea2b6b335b
X-Runtime: 0.087543
Content-Length: 315

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "kAJvMK390o",
      "account_id": "OobKawoJ7E",
      "ticket_id": "MvbX70D8Rm",
      "contact_id": "webY04D8aE",
      "type": "sale",
      "context": "Bought an avocado ($2) and was interested in a subscription",
      "revenue": 2.0,
      "element_id": "3YnbgeJae2",
      "element_type": "CustomEvent",
      "sent_at": 1571352174.68686
    }
  }
}

Add Event (Ticket id)

Using your auth id + secret you can append an Event directly into a Conversation stream based on the Ticket id

Endpoint

POST /v1/tickets/:id/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
id required (URL) Ticket id to add event to
type required Type of event to log: click, sale, etc.
context Context to save regarding the event
revenue Value created for your team from this event

Request

Route

POST /v1/tickets/5D9RB0G9VA/events

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "3o48OLwbeA",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "type": "sale",
  "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
  "revenue": 15.5
}

cURL

curl "https://www.avochato.com/v1/tickets/5D9RB0G9VA/events" -d '{"auth_id":"3o48OLwbeA","auth_secret":"YYYYYYYYYYYYYYYYYYYY","type":"sale","context":"Wanted one hat ($10) and upsold warranty ($5.50)","revenue":15.5}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 920e6608-b103-45dc-8597-772f26cbb6c6
X-Runtime: 0.091743
Content-Length: 305

Body

{
  "status": 200,
  "data": {
    "event": {
      "user_id": "webY0Ge8aE",
      "account_id": "o48OvAxJeA",
      "ticket_id": "5D9RB0G9VA",
      "contact_id": "EnJd0jgJRm",
      "type": "sale",
      "context": "Wanted one hat ($10) and upsold warranty ($5.50)",
      "revenue": 15.5,
      "element_id": "RkAJvlb0oL",
      "element_type": "CustomEvent",
      "sent_at": 1571352174.41162
    }
  }
}

Fetch Events

Using your auth id + secret you can fetch Events in a Ticket based on Ticket ids

Endpoint

GET /v1/tickets/:ids/events

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Ticket ids to fetch the event stream
page Page to request

Request

Route

GET /v1/tickets/lYJp6lobmw/events?auth_id=PDz9nnA9e3&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=PDz9nnA9e3
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/lYJp6lobmw/events?auth_id=PDz9nnA9e3&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 4a425810-25b0-4fad-879b-c51f0c4b0efb
X-Runtime: 0.036304
Content-Length: 2103

Body

{
  "status": 200,
  "data": {
    "events": [
      {
        "account_id": "Dz9nV0R9e3",
        "ticket_id": "lYJp6lobmw",
        "user_id": "EnJd0N0JRm",
        "status": "Closed",
        "element_id": "ZMvbX748Rm",
        "element_type": "StatusChange",
        "sent_at": 1571352174.27322
      },
      {
        "account_id": "Dz9nV0R9e3",
        "call_from": "+15551234567",
        "call_to": "+15558888888",
        "voicemail": null,
        "direction": "in",
        "call_status": "completed",
        "ended_at": null,
        "duration": 119,
        "segments": 2,
        "element_id": "zPG9yLQbaO",
        "element_type": "Call",
        "sent_at": 1571352174.26444
      },
      {
        "uuid": "73c91258-e5c9-49e4-99c8-be1f287e415e",
        "account_id": "Dz9nV0R9e3",
        "ticket_id": "lYJp6lobmw",
        "contact_id": "vnJAvBB8AD",
        "sender_id": "EnJd0N0JRm",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "message": "Sorry in a meeting but can call afterwards",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "queued",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1571352174.25335,
        "sent_at": 1571352174.25603,
        "element_id": "3NbrBnDbr6",
        "element_type": "SmsMessage"
      },
      {
        "uuid": "c07666b3-0a92-4a10-92e9-b2d0813ef94f",
        "account_id": "Dz9nV0R9e3",
        "ticket_id": "lYJp6lobmw",
        "contact_id": "vnJAvBB8AD",
        "sender_id": "EnJd0N0JRm",
        "sender_type": "User",
        "to": null,
        "from": null,
        "direction": "out",
        "message": "Hey there Bob let me know when we can talk!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "queued",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1571352174.24404,
        "sent_at": 1571352174.24658,
        "element_id": "N6bwZRO8DM",
        "element_type": "SmsMessage"
      },
      {
        "account_id": "Dz9nV0R9e3",
        "call_from": "+15558888888",
        "call_to": "+15551234567",
        "voicemail": null,
        "direction": "out",
        "call_status": "completed",
        "ended_at": null,
        "duration": 10,
        "segments": 1,
        "element_id": "AEgb5448ej",
        "element_type": "Call",
        "sent_at": 1571352174.23293
      },
      {
        "account_id": "Dz9nV0R9e3",
        "ticket_id": "lYJp6lobmw",
        "user_id": "EnJd0N0JRm",
        "status": "Open",
        "element_id": "KRg80gaJj0",
        "element_type": "StatusChange",
        "sent_at": 1571352174.22568
      },
      {
        "account_id": "Dz9nV0R9e3",
        "ticket_id": "lYJp6lobmw",
        "user_id": "EnJd0N0JRm",
        "owner_id": "EnJd0N0JRm",
        "element_id": "z1N8xapb37",
        "element_type": "OwnerChange",
        "sent_at": 1571352174.22008
      }
    ]
  }
}

Messages

Filter Messages via timestamp

Using your auth id + secret you can search for matching Messages based on a query

Endpoint

GET /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String, Query to search Messages (default: iterate through all messages)
page Integer, Page to request
direction String, Direction of the message ("in" for received messages, "out" for sent messages)
status String, Message delivery status (ie: queued, delivered, undelivered, failed)
from String, Phone number message was sent from
to String, Phone number message was sent to
created_at[from] Unix timestamp, Select messages created after this date
created_at[to] Unix timestamp, Select messages created before this date (default: now)

Request

Route

GET /v1/messages?auth_id=VePJlD6Jar&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1571352120.134586&created_at%5Bto%5D=1571352240.1346402&document=private

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=VePJlD6Jar
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1571352120.134586", "to"=>"1571352240.1346402"}
document=private

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=VePJlD6Jar&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1571352120.134586&created_at%5Bto%5D=1571352240.1346402&document=private" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: fa045fcc-7c73-4197-90ae-db4e438fb6e9
X-Runtime: 0.026499
Content-Length: 569

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "2da1d8b8-b092-4fa5-a157-89d783be5e3d",
        "account_id": "DjJBnBXJoO",
        "ticket_id": "3NbrzBjbr6",
        "contact_id": "jRbkdax91P",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "message": "I kept hearing that you had great service 😀!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "delivered",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1571352180.0797,
        "sent_at": 1571352180.08125,
        "element_id": "OobKaPXJ7E",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Search Messages

Using your auth id + secret you can search for matching Messages based on a query

Endpoint

GET /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String, Query to search Messages (default: iterate through all messages)
page Integer, Page to request
direction String, Direction of the message ("in" for received messages, "out" for sent messages)
status String, Message delivery status (ie: queued, delivered, undelivered, failed)
from String, Phone number message was sent from
to String, Phone number message was sent to
created_at[from] Unix timestamp, Select messages created after this date
created_at[to] Unix timestamp, Select messages created before this date (default: now)

Request

Route

GET /v1/messages?auth_id=wd6JmDA97m&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1571346179.7065878&created_at%5Bto%5D=1571352239.7066681

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=wd6JmDA97m
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=hear
page=1
direction=in
status=delivered
from=+15105551234
to=+14155551234
created_at={"from"=>"1571346179.7065878", "to"=>"1571352239.7066681"}

cURL

curl -g "https://www.avochato.com/v1/messages?auth_id=wd6JmDA97m&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=hear&page=1&direction=in&status=delivered&from=%2B15105551234&to=%2B14155551234&created_at%5Bfrom%5D=1571346179.7065878&created_at%5Bto%5D=1571352239.7066681" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 6b04c799-3d62-443c-b8c6-2609f325157f
X-Runtime: 0.038197
Content-Length: 569

Body

{
  "status": 200,
  "data": {
    "messages": [
      {
        "uuid": "e08d4b69-3a02-46c7-80dd-176c6a37d3bf",
        "account_id": "zjJ762Z95y",
        "ticket_id": "QR91xDKbge",
        "contact_id": "zjJ7Wj7J5y",
        "sender_id": null,
        "sender_type": null,
        "to": "+14155551234",
        "from": "+15105551234",
        "direction": "in",
        "message": "I kept hearing that you had great service 😀!",
        "contents": [

        ],
        "segments": 1,
        "carrier": null,
        "external_id": null,
        "status": "delivered",
        "error_code": 0,
        "reason": null,
        "status_callback": null,
        "created_at": 1571352179.6311,
        "sent_at": 1571352179.63466,
        "element_id": "Dz9nVyg9e3",
        "element_type": "SmsMessage"
      }
    ]
  },
  "page": 1
}

Send Message

Using your auth id + secret you can send a Message to any Contact based on their phone

Endpoint

POST /v1/messages

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number to send
message required Text to send in SMS
from String, Phone number in the account to try to send from
mark_addressed Boolean, Mark the message conversation as addressed (default: false)
media_url String, Url of media to send in MMS (500kb limit)
tags String, Comma-separated list of tags to apply to this contact
status_callback String, Domain to send callback http POST requests when the status is updated

Request

Route

POST /v1/messages

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "ZMvbXNLJRm",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+14155553333",
  "message": "test message",
  "from": "+15105551234",
  "mark_addressed": "true",
  "tags": "Some Tag, Another Tag",
  "status_callback": "http://my.domain.com"
}

cURL

curl "https://www.avochato.com/v1/messages" -d '{"auth_id":"ZMvbXNLJRm","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+14155553333","message":"test message","from":"+15105551234","mark_addressed":"true","tags":"Some Tag, Another Tag","status_callback":"http://my.domain.com"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 3e681851-fb02-412c-9449-a9dad0575ec3
X-Runtime: 0.159205
Content-Length: 543

Body

{
  "status": 200,
  "data": {
    "message": {
      "uuid": "b65e03e2-cf7c-4098-b5d1-712b6ef861b8",
      "account_id": "ePJl7Qo9ar",
      "ticket_id": "Rg80gK4Jj0",
      "contact_id": "ePJlYN68ar",
      "sender_id": "5D9RBGG9VA",
      "sender_type": "User",
      "to": "+14155553333",
      "from": null,
      "direction": "out",
      "message": "test message",
      "contents": [

      ],
      "segments": 1,
      "carrier": "twilio",
      "external_id": null,
      "status": "queued",
      "error_code": 0,
      "reason": null,
      "status_callback": "http://my.domain.com",
      "created_at": 1571352179.21922,
      "sent_at": 1571352179.21683,
      "element_id": "Ynbgnyy8ae",
      "element_type": "SmsMessage"
    }
  }
}

Tags

Add Tag (Contact id)

You can add a new tag to Contacts

Endpoint

POST /v1/contacts/:ids/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to tag
tag required Tag to add to Contacts

Request

Route

POST /v1/contacts/1N8xMeAb37%2C7Mb6krO9ER/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "Pe6begxJXw",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "tag": "my-new-tag"
}

cURL

curl "https://www.avochato.com/v1/contacts/1N8xMeAb37%2C7Mb6krO9ER/tags" -d '{"auth_id":"Pe6begxJXw","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-new-tag"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 3086d23e-400c-4d93-8ca0-17cd5c2e2c51
X-Runtime: 0.035712
Content-Length: 94

Body

{
  "status": 200,
  "data": {
    "action": "tagged",
    "tag": "my-new-tag",
    "ids": [
      "1N8xMeAb37",
      "7Mb6krO9ER"
    ]
  }
}

Add Tag (Phone)

You can add a new tag to a Contact based on phone number

Endpoint

POST /v1/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
tag required Tag to add to Contacts

Request

Route

POST /v1/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "EDR8zZV8A2",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-new-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"EDR8zZV8A2","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-new-tag"}' -X POST \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: a178a320-0496-4ab6-abc5-30bb7dc3d1f8
X-Runtime: 0.043368
Content-Length: 81

Body

{
  "status": 200,
  "data": {
    "action": "tagged",
    "tag": "my-new-tag",
    "ids": [
      "LxJD5Rg8n2"
    ]
  }
}

Remove Tag (Contact id)

You can remove an old tag from Contacts

Endpoint

DELETE /v1/contacts/:ids/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL) Comma separated list of Contact ids to untag
tag required Tag to remove from Contacts

Request

Route

DELETE /v1/contacts/YnbgEegJae%2CkAJvMe190o/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "BDr8GvaJPl",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "tag": "my-old-tag"
}

cURL

curl "https://www.avochato.com/v1/contacts/YnbgEegJae%2CkAJvMe190o/tags" -d '{"auth_id":"BDr8GvaJPl","auth_secret":"YYYYYYYYYYYYYYYYYYYY","tag":"my-old-tag"}' -X DELETE \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 123a0ada-7e86-481e-82f4-d241692b72c8
X-Runtime: 0.116557
Content-Length: 96

Body

{
  "status": 200,
  "data": {
    "action": "untagged",
    "tag": "my-old-tag",
    "ids": [
      "YnbgEegJae",
      "kAJvMe190o"
    ]
  }
}

Remove Tag (Phone)

You can remove an old tag from a Contact based on phone number

Endpoint

DELETE /v1/tags

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
phone required Phone number of the Contact
tag required Tag to remove from Contacts

Request

Route

DELETE /v1/tags

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "1K2b2nXbWR",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "phone": "+15551234567",
  "tag": "my-old-tag"
}

cURL

curl "https://www.avochato.com/v1/tags" -d '{"auth_id":"1K2b2nXbWR","auth_secret":"YYYYYYYYYYYYYYYYYYYY","phone":"+15551234567","tag":"my-old-tag"}' -X DELETE \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 4e67b089-ada4-4bd9-be09-477f043de606
X-Runtime: 0.044457
Content-Length: 83

Body

{
  "status": 200,
  "data": {
    "action": "untagged",
    "tag": "my-old-tag",
    "ids": [
      "o48Omdw9eA"
    ]
  }
}

Ticket Assignment

Ticket Assignment represents which user on your team owns a conversation. The owner assigned to a conversation will receive notifications of incoming calls and texts from that contact.

Auto Assign

You can automatically reassign one or more Tickets to any user in the Auto Assignment Roster by id. If there are no active users in your Auto Assignment Roster, ownership will remain unchanged. See Settings > Auto Assignment

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id required autoassign string

Request

Route

PUT /v1/tickets/ePJlY7d8ar

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "zPG9y6AJaO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "autoassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/ePJlY7d8ar" -d '{"auth_id":"zPG9y6AJaO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"autoassign"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: f4a15a68-baab-48ef-9a55-f1956b2ce5fc
X-Runtime: 0.135704
Content-Length: 234

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "ePJlY7d8ar",
        "uuid": "695a023f-5535-4def-a53a-8a9e17854277",
        "contact": "DR8zpeV9A2",
        "user_id": "OLb4pz3b4Y",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352176.270946
      }
    ]
  }
}

Unassign

You can unassign one or more Tickets by id.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id required unassign string

Request

Route

PUT /v1/tickets/DjJBNnmJoO

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "Pweboz58Xm",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "unassign"
}

cURL

curl "https://www.avochato.com/v1/tickets/DjJBNnmJoO" -d '{"auth_id":"Pweboz58Xm","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"unassign"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 534becba-0894-40b9-bd73-97d0d4cfad1a
X-Runtime: 0.085817
Content-Length: 227

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "DjJBNnmJoO",
        "uuid": "3910c074-99f8-4a2b-b7f9-5be7ca28a18e",
        "contact": "e6beWOxJXw",
        "user_id": null,
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352176.6674292
      }
    ]
  }
}

Update Assignment with user_email

You can assign a User to be the owner of one or more Tickets by email.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_email User email of the new owner string

Request

Route

PUT /v1/tickets/nL8ajAwb7N%2CjRbkdRX91P

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "GeAbZmA8DM",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_email": "person_15@example.com"
}

cURL

curl "https://www.avochato.com/v1/tickets/nL8ajAwb7N%2CjRbkdRX91P" -d '{"auth_id":"GeAbZmA8DM","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_email":"person_15@example.com"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 7b620eaa-574c-47f6-b0c9-ee639e49f0a4
X-Runtime: 0.160272
Content-Length: 436

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "jRbkdRX91P",
        "uuid": "3116c620-6544-4623-9d71-47417ae49160",
        "contact": "OLb4p1Ob4Y",
        "user_id": "PG9yw2k8aO",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352176.998038
      },
      {
        "id": "nL8ajAwb7N",
        "uuid": "b1432f33-a39d-487e-a78d-380a6fad726e",
        "contact": "ZA9P4Yd9rw",
        "user_id": "PG9yw2k8aO",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352177.004939
      }
    ]
  }
}

Update Assignment with user_id

You can assign a User to be the owner of one or more Tickets by id.

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
user_id User ID of the new owner string

Request

Route

PUT /v1/tickets/LP9MMzZ9qY%2CxB9NXQB8YO

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "xoWbq609qn",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "user_id": "eAbZno0bDM"
}

cURL

curl "https://www.avochato.com/v1/tickets/LP9MMzZ9qY%2CxB9NXQB8YO" -d '{"auth_id":"xoWbq609qn","auth_secret":"YYYYYYYYYYYYYYYYYYYY","user_id":"eAbZno0bDM"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 77a21cf7-7539-4cdc-8743-1485d403c5fa
X-Runtime: 0.156465
Content-Length: 436

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "xB9NXQB8YO",
        "uuid": "06cc7c0e-c679-499e-8cb5-48aee7378d21",
        "contact": "QL9WyO38Wq",
        "user_id": "eAbZno0bDM",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352177.416873
      },
      {
        "id": "LP9MMzZ9qY",
        "uuid": "57c0ee6d-e3e8-44d4-a8ee-662261cc956a",
        "contact": "Egb5WwoJej",
        "user_id": "eAbZno0bDM",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352177.422316
      }
    ]
  }
}

Ticket Status

Ticket Status represents the state of a conversation, and can be used to organize your inbox. Tickets marked as Closed are archived and do not appear in the inbox by default.

Close a Ticket

Mark one or more Tickets as Closed. Note: this will also automatically mark the ticket as ‘Addressed’

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
status Use the 'Closed' Status to close a ticket string

Request

Route

PUT /v1/tickets/vnJAvv18AD

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "ezjJ7G7J5y",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "status": "Closed"
}

cURL

curl "https://www.avochato.com/v1/tickets/vnJAvv18AD" -d '{"auth_id":"ezjJ7G7J5y","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Closed"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 860bd166-cbc0-4335-8147-4235e5bb1417
X-Runtime: 0.099028
Content-Length: 235

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "vnJAvv18AD",
        "uuid": "332a5b87-c37f-422f-87f9-14e69b9153de",
        "contact": "LP9MMRg9qY",
        "user_id": "ePJlYVd8ar",
        "unaddressed": false,
        "status": "Closed",
        "origin": "Avochato",
        "created_at": 1571352180.46557
      }
    ]
  }
}

Update Status

You can update the status of one or more Tickets

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
status The current Ticket Status. Options include "New", Open", "Pending", "Closed" string

Request

Route

PUT /v1/tickets/webY00e8aE%2CEnJd000JRm

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "xDjJBwd8oO",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "status": "Pending"
}

cURL

curl "https://www.avochato.com/v1/tickets/webY00e8aE%2CEnJd000JRm" -d '{"auth_id":"xDjJBwd8oO","auth_secret":"YYYYYYYYYYYYYYYYYYYY","status":"Pending"}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 5aff652f-1840-4d43-9b5b-83fda609504e
X-Runtime: 0.116579
Content-Length: 431

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "EnJd000JRm",
        "uuid": "59b802c0-1c00-4861-9c45-d2576a999023",
        "contact": "AnJQzlR8y1",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352180.813523
      },
      {
        "id": "webY00e8aE",
        "uuid": "e5b464ec-463b-44b6-a4ae-a76fb3b00b17",
        "contact": "nMJLNK4bvZ",
        "user_id": "zjJ7WZPJ5y",
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352180.818014
      }
    ]
  }
}

Tickets

Tickets represent a unique conversation with a Contact in an Avochato Account.

Fetch Tickets

You can fetch Tickets by ids

Endpoint

GET /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
page Page to request

Request

Route

GET /v1/tickets/OobK11RJ7E%2Co48Omme9eA?auth_id=0nMJLk49vZ&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=0nMJLk49vZ
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets/OobK11RJ7E%2Co48Omme9eA?auth_id=0nMJLk49vZ&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 6a1e04f9-03e8-4c6d-9b90-33959c33b9f6
X-Runtime: 0.017145
Content-Length: 435

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "OobK11RJ7E",
        "uuid": "15e54295-f0a8-4e14-9759-d05a668f0085",
        "contact": "Dz9nXQA8e3",
        "user_id": "AnJQzGY8y1",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352183.536649
      },
      {
        "id": "o48Omme9eA",
        "uuid": "1334b7d6-e81b-47d5-a6fa-4f67f1b3f818",
        "contact": "LxJD5Kg8n2",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352183.5268
      }
    ]
  },
  "page": 1
}

List all Tickets

You can retrieve a paginated list of all Tickets within an account

Endpoint

GET /v1/tickets

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
page Page to request

Request

Route

GET /v1/tickets?auth_id=KRg80pk8j0&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=KRg80pk8j0
auth_secret=YYYYYYYYYYYYYYYYYYYY
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=KRg80pk8j0&auth_secret=YYYYYYYYYYYYYYYYYYYY&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 33812894-16be-44b5-bf5e-927f9d38ac3c
X-Runtime: 0.024847
Content-Length: 438

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "1N8xMMmb37",
        "uuid": "6d358847-fa73-40a9-9deb-1bf50c8035c1",
        "contact": "OobK1WNJ7E",
        "user_id": "nMJLNG3bvZ",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352183.780947
      },
      {
        "id": "7Mb6kk49ER",
        "uuid": "b0bd3622-357b-4848-90b2-756ca5f4dd07",
        "contact": "o48OmXw9eA",
        "user_id": null,
        "unaddressed": false,
        "status": "Pending",
        "origin": "Avochato",
        "created_at": 1571352183.7757561
      }
    ]
  },
  "page": 1
}

Search Tickets

You can search for matching Tickets based on a query

Endpoint

GET /v1/tickets

Parameters

Name Description
auth_id required Auth Id field
auth_secret required Authentication Secret field
query String to search Tickets with (default: iterate through all tickets)
page Page to request

Request

Route

GET /v1/tickets?auth_id=WAnJQXR9y1&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1

Headers

Content-Type: application/json
Host: www.avochato.com

Query Parameters

auth_id=WAnJQXR9y1
auth_secret=YYYYYYYYYYYYYYYYYYYY
query=status:Open
page=1

cURL

curl -g "https://www.avochato.com/v1/tickets?auth_id=WAnJQXR9y1&auth_secret=YYYYYYYYYYYYYYYYYYYY&query=status%3AOpen&page=1" -X GET \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: 972eb1d8-5b6f-420a-a064-556aa89ee51a
X-Runtime: 0.019960
Content-Length: 243

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "Dz9nXXj8e3",
        "uuid": "b7d41f12-1b30-464c-a7ce-382154b592e3",
        "contact": "YnbgElgJae",
        "user_id": "LP9MMGZ9qY",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352183.266908
      }
    ]
  },
  "page": 1
}

Update Unaddressed

You can mark a ticket as Addressed or Unaddressed automatically

Endpoint

PUT /v1/tickets/:ids

Parameters

Name Description type
auth_id required Auth Id field
auth_secret required Authentication Secret field
ids required (URL parameter) Comma separated list of Ticket id(s) string
unaddressed Flag whether the current ticket remains unaddressed. True or False boolean

Request

Route

PUT /v1/tickets/YnbgEE6Jae

Headers

Content-Type: application/json
Host: www.avochato.com

Body

{
  "auth_id": "BLP9Mag9qY",
  "auth_secret": "YYYYYYYYYYYYYYYYYYYY",
  "unaddressed": false
}

cURL

curl "https://www.avochato.com/v1/tickets/YnbgEE6Jae" -d '{"auth_id":"BLP9Mag9qY","auth_secret":"YYYYYYYYYYYYYYYYYYYY","unaddressed":false}' -X PUT \
	-H "Content-Type: application/json" \
	-H "Host: www.avochato.com"

Response

Simulated Response

Status

200

Headers

Content-Type: application/json; charset=utf-8
X-Request-Id: ba3714e6-1e89-4abf-8374-12e7a7147275
X-Runtime: 0.017766
Content-Length: 234

Body

{
  "status": 200,
  "data": {
    "tickets": [
      {
        "id": "YnbgEE6Jae",
        "uuid": "88df114f-b703-4610-a905-bf46b6bd873c",
        "contact": "webY0LD8aE",
        "user_id": "xB9NXWB8YO",
        "unaddressed": false,
        "status": "Open",
        "origin": "Avochato",
        "created_at": 1571352182.979239
      }
    ]
  }
}