Send a File

API will send a file in current chat session to visitor.

Resource URL

https://Server Node Environment/index.php

Example : https://api.yourdomain.com/index.php

Resource Information

Parameters Values
Resource Format JSON
Method POST
Requires authentication? Yes

Request

GET Params

Parameters Mandatory Description
[Request parameters]
d REQUIRED api - Controller directory name
c REQUIRED chat - Controller name
m REQUIRED upload_file - Controller method name
token REQUIRED Application Access Token

POST Params

Parameters Mandatory Description
[Request parameters]
sender_id REQUIRED Sender ID
csid REQUIRED Chat Sender ID
device_id REQUIRED Device ID to send push notification. It will be long string like: dozGN2D-CRs:APA91bFG34cyrSE6_j11z662rhosjtW5fsXXoWTPAxaywEol7bOXGC6IYmBvvTZaucio55LMmkIkEAyrOAry0qEi3C8aT5hAenMCJvbg0c6KK08h3OwILh1PeGxeFJ06ck5OGmTN4YPj
sort_order REQUIRED Time in milliseconds based on Server Time
message_status REQUIRED read or unread
shared_file REQUIRED $_FILES array
filetype REQUIRED file mime type like: image/jpeg
filename REQUIRED filename with extention like: logo.png
filesize REQUIRED 456887

Response


{
    "result": "success",
    "language_version": 20171221061942,
    "messageId": 4255,
    "chat_message": "http://yoursite.com/chatbull/uploads/chatfiles/34820180529104425_pexels-photo.jpg",
    "sortOrder": "1527588610870"
}

Messages returned

HTTP STATUS CODE Description MESSAGE BODY
200 Successfully Return Return data in JSON format.
200 Authorization Error {"result":"failed","error":"Invalid access token or Token has been expired."}
400 Request is malformed {"error": "invalid_request", "error_description": "description"}
403 Forbidden Directory access is forbidden.
404 Resource Not found The page you requested was not found.