• Notifications
  • Messages
  • Complaints
  • Offers
  • Chats
  • Logout
  • РУС ENG

API




Getting a list of dialogs

The URL for sending a request: https://api.digiseller.com/api/debates/v2/chats?token={token}
Method: GET
Request headers: Accept: "application/json"
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: View
method to get access token
filter_newunread message filter0 — all dialogs;
1 — dialogs with unread messages only.
Default value is 0.
emailbuyer email filter
id_dsfilter by product idseparator — comma. Example: id_ds=1,2,3
pagesizepage sizemaximum value is 200.
Default value is 20
pagepage numberdefault value is 1
Response format:
{ "cnt_pages": 5, "items": [ { "id_i": 129647692, "email": "user@example.com", "product": "digital product", "last_date": "2022-02-10 20:37:19", "cnt_msg": 16, "cnt_new": 3 }, ... ] }
Response parameters:
NameUseComment
cnt_pagesthe number of pages
itemsarray of dialogs
items\id_iorder number
items\emailbuyer's email
items\productproduct name
items\last_datedate and time of the last message
items\cnt_msgnumber of messages
items\cnt_newnumber of unread messages



Getting dialog status

The URL for sending a request: https://api.digiseller.com/api/debates/v2/chat-state?token={token}&id_i={id_i}
Method: GET
Request headers: Accept: "application/json"
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: View
method to get access token
id_iorder number
Response format:
{ "chat_state": 1, "may_change": 0, }
Response parameters:
NameUseComment
chat_statedialog status0 — the dialog is closed; 1 — the dialog is open by the seller; 2 — the dialog is open by the admin.
may_changepermission to change the status of the dialog0 — not allowed; 1 — allowed.



Changing the status of a dialog

The URL for sending a request: https://api.digiseller.com/api/debates/v2/chat-state?token={token}&id_i={id_i}&chat_state={chat_state}
Method: POST
Request headers: Accept: "application/json"
Content-Type: "application/json"
Request format: empty
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: Send
method to get access token
id_iorder number
chat_statedialog status 0 — open; 1 — close.
* closing the dialog is not possible if it was opened by the admin.
* closing the dialogue is not possible with an open dispute with negative feedback.
Response format: empty
* empty response with HTTP status code 200 means success.



Getting a list of messages

The URL for sending a request: https://api.digiseller.com/api/debates/v2?token={token}&id_i={id_i}
Method: GET
Request headers: Accept: "application/json"
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: View
method to get access token
id_iorder number
hiddenreturn deleted messages0 | 1
id_frommessage ID starting from which to get
id_tomessage ID up to which to receive (inclusive)
old_idmessage ID that has already been receivedignored if id_from and id_to are given
newerreturn all unreceived messages0 | 1.
Ignored if id_from and id_to are given.
counthow many messages to returnmaximum value is 200.
Default value is 20.
Ignored if id_from and id_to, or newer are given.
Response format:
[ { "id": 56627081, "message": "screenshot.png", "buyer": 1, "seller": 0, "deleted": 0, "date_written": "2022-01-25 10:37:13", "date_seen": "2022-01-25 10:37:20", "is_file": 1, "filename": "screenshot.png", "url": "https://my.digiseller.com/attach/129647692/56627081/image.png", "is_img": 1, "preview": "https://graph.digiseller.ru/img_deb.ashx?f=129647692/56627081/image.png&w=200" }, ... ]
Response parameters:
NameUseComment
idmessage_id
messagemessage_text
buyera sign that the message is from the buyer0 | 1
sellera sign that the message is from the seller0 | 1
deleteddeleted0 | 1
date_writtendate and time the message was sent
date_seendate and time the message was read
is_fileindication that the message is a file0 | 1
filenameoriginal filename
urlfile URL
is_imgsign that the message is an image0 | 1
previewImage thumbnail URL

* all fields, except for ID and Message, may be missing in the response.
* after receiving all messages of the dialog, you need to call the "Setting the read flag" method.



Setting the read flag

The URL for sending a request: https://api.digiseller.com/api/debates/v2/seen?token={token}&id_i={id_i}
Method: POST
Request headers: Accept: "application/json"
Content-Type: "application/json"
Request format: empty
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: View
method to get access token
id_iorder number
Response format:
empty
* empty response with HTTP status code 200 means success.



Preuploading files

The URL for sending a request: https://api.digiseller.com/api/debates/v2/upload-preview?token={token}&lang={lang}
Request headers: Accept: "application/json"
Content-Type: "multipart/form-data"
Method: POST
Request format: "files[]": binary data
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: Send
method to get access token
langthe information display languageru-RU (by default) or en-US
Response format:
{ "files": [ { "newid": "", "name": "", "type": "", "size": 10, "message": "", "error": "", "error_num": 0 }, ... ] }
Response parameters:
NameUseComment
filesarray of uploaded files
files\newiduploaded file IDstring
files\namefile name
files\typefile type
files\sizefile size
files\messagefile upload success message
files\errorfile upload error message
files\error_numfile upload error code0 — success; otherwise failure.

* to send preloaded files, you must call the method to send a new message.



Sending a new message

The URL for sending a request: https://api.digiseller.com/api/debates/v2/?token={token}&id_i={id_i}
Method: POST
Request headers: Accept: "application/json"
Content-Type: "application/json"
Request format: { "message": "", "files": [ { "newid": "", "name": "", "type": "" }, ... ] }
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: Send
method to get access token
id_iorder number
messagemessage_text
filesarray of uploaded filesobtained from the file preupload method
files\newiduploaded file ID
files\namefile name
files\typefile type
Response format:
empty
* empty response with HTTP status code 200 means success.



Deleting a message

The URL for sending a request: https://api.digiseller.com/api/debates/v2/{id}?token={token}&id_i={id_i}
Method: DELETE
Request headers: Accept: "application/json"
Request parameters:
NameUseComment
token access token,
min. permission: [ Correspondence with buyers ]: Delete
method to get access token
id_iorder number
idmessage_id
Response format:
[]
Response parameters: * an empty array in the response means success.