Start conversation on behalf of a user

This method creates a dialog that was initiated by the user on the site (the first message in the dialog is from the user).

To create a dialog in which the first message is from the administrator you should use the method of sending the message to the user /users/{id}/sendmessage.

URL

POST https://api.dashly.app/v1/users/{id}/startconversation

For {id} you can use:

  • Dashly ID
  • Your User ID (in case user with such ID does not exist, new user with such ID is created).
    Send with by_user_id=true parameter.

Arguments

This method follows the general rules. Arguments are transmitted as GET or POST parameters.

Argument Type Description
auth_token string Required. Authorization token
by_user_id bool If flag is set, id in URL should be User ID
body string Required. Text of the message.
file file Optional. Attachment file. Files up to 10 Mbytes are supported. File type should be one of jpg, jpeg, png, gif, pdf, rar, zip, html, csv, docx, doc, xlsx, xls, txt, sig.
filename string Required, if file parameter is set. File name by which file is displayed in chat.
random_id number Optional. Random number which is used to associate reply data received via RTS API, if it comes earlier than server response for this request. This number is returned in reply data.
referrer string, URL Optional. Page URL from which user started the conversation.

Answer

{
  "meta": {
    "status": 200
  },
  "data": {
    "id": 1856194,
  }
}

Answer contains conversation ID.

Example

curl -X POST \
  --data-urlencode 'body=Hello' \
  --data-urlencode 'auth_token=XXX' \
  https://api.dashly.app/v1/users/3964935/startconversation