Skip to main content
POST
/
data
/
{class_name}
/
{custom_object_record_id}
/
file.json
curl -X POST \
-H "QB-Token: a04ed6adfdb98cde99837088830349f67d012bba" \
-F "field_name=avatar" \
-F 'file=@"my_avatar.jpg"' \
https://api.quickblox.com/data/UserProfileClass/5d863a78a0eb474dae6099c6/file.json
{
  "file_id": "5d863c18a28f9a3a551cb557",
  "size": 2004727,
  "name": "Image.jpg",
  "content_type": "image/jpeg"
}

Documentation Index

Fetch the complete documentation index at: https://docs.quickblox.com/llms.txt

Use this file to discover all available pages before exploring further.

Recipes

1

1. Use 'Authorization' header to pass API key

curl -X POST \
-H "Authorization: ApiKey 28irlNAGasWDSupO9Vw0BBMZfuHrAUYKpmroS9yBORI" \
-F "field_name=avatar" \
-F 'file=@"my_avatar.jpg"' \
https://api.quickblox.com/data/UserProfileClass/5d863a78a0eb474dae6099c6/file.json
2

2. As a result, the file is uploaded and the API returns its metadata.

{
  "file_id": "5d863c18a28f9a3a551cb557",
  "size": 2004727,
  "name": "Image.jpg",
  "content_type": "image/jpeg"
}

Path Parameters

class_name
string
required
Custom object class name.
custom_object_record_id
string
required
ID of the custom object record. Generated automatically by the server after record creation.

Body Parameters

field_name
string
required
Custom object record field which contains a file.
file
file
required
File for uploading. The max file size is 32 MB.

Headers

QB-Token
string
required
A user or application session token. See Authentication page to learn more about session tokens. Must be used either QB-Token or Authorization.
Authorization
string
default:"ApiKey {your_api_key}"
API key from Dashboard. Expected format: ApiKey {your_api_key}. Must be used either QB-Token or Authorization.
On-Behalf-Of
string
User ID. The user ID of the user on whose behalf the request is being made.

Responses

A successful response
file_id
string
size
integer
name
string
content_type
string
An error response
errors
array of strings
An error response
errors
array of strings
curl -X POST \
-H "QB-Token: a04ed6adfdb98cde99837088830349f67d012bba" \
-F "field_name=avatar" \
-F 'file=@"my_avatar.jpg"' \
https://api.quickblox.com/data/UserProfileClass/5d863a78a0eb474dae6099c6/file.json
{
  "file_id": "5d863c18a28f9a3a551cb557",
  "size": 2004727,
  "name": "Image.jpg",
  "content_type": "image/jpeg"
}