Skip to content
FacebookYouTubeX (Twitter)

Files

You can use the API to get or upload binary files.

POST https://api.pingstreams.com/v3/files/users

Allows to upload an file with autentication

HeaderTypeDescription
Authorizationstringauthorization token. Basic Auth or JWT
Content-Typestringuse “multipart/form-data” value
FieldTypeDescription
filebinarythe binary file
{
"message":"File uploded successfully",
"filename":"uploads/users/5ebd890292befe0019054973/files/27a8e524-d854-4aff-a6c7-84cb02681f34/README.md"
}
curl -v -X POST -H 'Content-Type: multipart/form-data' -u user@example.com:123456 -F file=@/Users/andrealeo/dev/chat21/pingstreams-server-dev-org/README.md https://api.pingstreams.com/v3/files/users

Get the binary file as stream by filename path

Section titled “Get the binary file as stream by filename path”

GET https://api.pingstreams.com/v3/files

HeaderTypeDescription
Authorizationstringauthorization token. Basic Auth or JWT

Returns binary file data as stream.

curl -v -X GET -H -u user@example.com:123456 https://api.pingstreams.com/v3/files?path=uploads/users/5ebd890292befe0019054973/files/27a8e524-d854-4aff-a6c7-84cb02681f34/README.md

GET https://api.pingstreams.com/v3/files/download

HeaderTypeDescription
Authorizationstringauthorization token. Basic Auth or JWT

Returns binary file data for download.

curl -v -X GET -H -u user@example.com:123456 https://api.pingstreams.com/v3/files/download?path=uploads/users/5ebd890292befe0019054973/files/27a8e524-d854-4aff-a6c7-84cb02681f34/README.md