/
4.1.8 Attachment

4.1.8 Attachment

Downloading the attachment

To download an attachment, send a GET request to the address /attachment/ID, where the ID should be replaced by the attachment identifier.

The method requires authorization using basic authentication. Please use your SIP account login and password.

In response we will receive:

  • when HTTP status = 200 - we will receive an attachment stream in the body
  • when HTTP status = 404 - attachment Not found

Downloading the thumbnail

To download the thumbnail, send a GET request to the address /attachment/thumbnail/ID, where the ID should be replaced by the attachment ID.

The method requires authorization using basic authentication. Please use your SIP account login and password.

In response we will receive:

  • when HTTP status = 200 - in the body we will receive the attachment stream
  • kiedy HTTP status = 404 - attachment Not found


Uploading the attachment

POST method to the address  /attachment

The method requires authorization using basic authentication. Please use your SIP account login and password.

In response we will receive:

  • when  HTTP status = 200 - recording deleted
  • when HTTP status = 404 - Not found


POST https://domena.com/attachment HTTP/1.1
Host: domena.com
User-Agent: {user-agent}
Authorization: Basic {login:password}
Content-Type: multipart/form-data; boundary=xxBOUNDARYxx
Content-Length: {POST body length in bytes}

--xxBOUNDARYxx
Content-Type: text/plain
Content-Disposition: form-data; name="r"

{recipients}
--xxBOUNDARYxx
Content-Type: video/mp4
Content-Disposition: form-data; name="file"; filename="attachment.ext"

{attachment file data bytes}
--xxBOUNDARYxx--
Content-Disposition: form-data; name="thumbnail"; filename="thumbnail.jpg"
Content-Type: image/png
 
{thumbnail file data bytes}
--xxBOUNDARYxx
 


Adding recipients to the attachment

To add recipients to the attachment, send a PUT request to the address /attachment/ID, where the ID should be replaced by the attachment ID. However, in the r parameter (as in the case of POST), you must provide SIP logins separated by a semicolon.

POST|/attachment?r=48666666666;4877777777777&g=&ct=image/jpeg|


The method requires authorization using basic authentication. Please use your SIP account login and password


Message format 

~[ATT RID:'%d' type:'%d' ext:'%s' or:'%d' caption:'%s']%s

documents type - 6, VCard type - 5


Example:

~[ID:d2f472]~[ATT RID:'1013820' type:'6' ext:'.doc' or:'0']{"filename":"sample.doc","size":32768,"contentType":"application\/msword"}


Related content