Images
You can use the API to get or upload images.
Upload a user image
Section titled “Upload a user image”POST https://api.pingstreams.com/v3/images/users
Allows to upload an image with autentication
Headers
Section titled “Headers”| Header | Type | Description |
|---|---|---|
Authorization | string | authorization token. Basic Auth or JWT |
Content-Type | string | use “multipart/form-data” value |
Request Body
Section titled “Request Body”| Field | Type | Description |
|---|---|---|
file | binary | the image binary file |
Response
Section titled “Response”{
"message":"File uploded successfully",
"filename":"uploads/users/5ebd890292befe0019054973/images/392224bb-0b1e-46b7-a131-183353be7645/test.jpg"
}Example:
Section titled “Example:”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/test.jpg" https://api.pingstreams.com/v3/images/usersGet the image binary by filename path
Section titled “Get the image binary by filename path”GET https://api.pingstreams.com/v3/images
Query Parameters
Section titled “Query Parameters”| Parameter | Type | Description |
|---|---|---|
path | string | the image path in the repository |
Headers
Section titled “Headers”| Header | Type | Description |
|---|---|---|
Authorization | string | authorization token. Basic Auth or JWT |
Response
Section titled “Response”Returns binary image data.
Example
Section titled “Example”curl -v -X GET -H -u user@example.com:123456 https://api.pingstreams.com/v3/images?path=uploads/users/5ebd890292befe0019054973/images/392224bb-0b1e-46b7-a131-183353be7645/test.jpg