Skip to main content
POST
/
blobs.json
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 2e80acd7f3d9c1e79312e0d1dafd6691ba012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
    "name":"museum.jpeg"
  }
}' \
https://api.quickblox.com/blobs.json
{
  "blob": {
    "id": 10070416,
    "uid": "20456a9676674f4ca950d963dfca630e00",
    "content_type": "image/jpeg",
    "name": "test2.jpg",
    "size": null,
    "created_at": "2020-07-29T11:06:31Z",
    "updated_at": "2020-07-29T11:06:31Z",
    "blob_status": null,
    "set_completed_at": null,
    "public": false,
    "account_id": 105726,
    "app_id": 78162,
    "blob_object_access": {
      "id": 10070416,
      "blob_id": 10070416,
      "expires": "2020-07-29T12:06:31Z",
      "object_access_type": "Write",
      "params": "https://api.quickblox.com/blobs/10070416/upload/?acl=authenticated-read&content_type=image%2Fjpeg&expires=2020-07-29%2012%3A06%3A31%20UTC&key=20456a9676674f4ca950d963dfca630e00&policy=OTVhNDNiZDNiMWMxMGZlNDgzMmE1MzEyYzE4MjYyZjI%3D%0A&success_action_status=201&x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=d9edd8e29a9f029549ecf6313c67c676%2F20200729%2Fqbprod%2Fs3%2Faws4_request&x-amz-date=2020211T1206Z&x-amz-signature=84901614d08e3d2d1fbba76dc5378242"
    }
  }
}

Recipe

1

1. Use a `blob` parameter to set blob fields

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
  }
}' \
https://api.quickblox.com/blobs.json
2

2. Set a content type of the file

Use a content-type parameter to set a content type of the file.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
  }
}' \
https://api.quickblox.com/blobs.json
3

3. Set a name of the file

Use a name parameter to set the name of the file.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
    "name":"my_cat.jpeg",
  }
}' \
https://api.quickblox.com/blobs.json
4

4. Set a file as public

Set a public parameter as true to make a file public.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
    "name":"my_cat.jpeg",
    "public":true,
  }
}' \
https://api.quickblox.com/blobs.json
5

5. Set tags to a file

Use a tag_list to assign tags to a file.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
    "name":"my_cat.jpeg",
    "public":true,
    "tag_list":"web,android"
  }
}' \
https://api.quickblox.com/blobs.json
6

6. As a result, the API returns a newly created public file.

{
  "blob": {
    "id": 10070416,
    "uid": "20456a9676674f4ca950d963dfca630e00",
    "content_type": "image/jpeg",
    "name": "my_cat.jpeg",
    "size": null,
    "created_at": "2020-07-29T11:06:31Z",
    "updated_at": "2020-07-29T11:06:31Z",
    "blob_status": null,
    "set_completed_at": null,
    "public": true,
    "account_id": 105726,
    "app_id": 78162,
    "blob_object_access": {
      "id": 10070416,
      "blob_id": 10070416,
      "expires": "2020-07-29T12:06:31Z",
      "object_access_type": "Write",
      "params": "https://api.quickblox.com/blobs/10070416/upload/?acl=authenticated-read&content_type=image%2Fjpeg&expires=2020-07-29%2012%3A06%3A31%20UTC&key=20456a9676674f4ca950d963dfca630e00&policy=OTVhNDNiZDNiMWMxMGZlNDgzMmE1MzEyYzE4MjYyZjI%3D%0A&success_action_status=201&x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=d9edd8e29a9f029549ecf6313c67c676%2F20200729%2Fqbprod%2Fs3%2Faws4_request&x-amz-date=2020211T1206Z&x-amz-signature=84901614d08e3d2d1fbba76dc5378242"
    }
  }
}
1

1. Use a `blob` parameter to set blob fields

curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{  
  }
}' \
https://api.quickblox.com/blobs.json
2

2. Set a content type of the file

Use a content-type parameter to set a content type of the file.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{
    "content_type":"image/jpeg",  
  }
}' \
https://api.quickblox.com/blobs.json
3

3. Set a name of the file

Use a name parameter to set the name of the file.
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: f8dd521e8a88b0df7e0c359dc3de73fc15012bba" \
-d '{  
  "blob":{
    "content_type":"image/jpeg",
    "name":"museum.jpeg"  
  }
}' \
https://api.quickblox.com/blobs.json
4

4. As a result, the API returns a newly created private file.

{
  "blob": {
    "id": 10070416,
    "uid": "20456a9676674f4ca950d963dfca630e00",
    "content_type": "image/jpeg",
    "name": "museum.jpeg",
    "size": null,
    "created_at": "2020-07-29T11:06:31Z",
    "updated_at": "2020-07-29T11:06:31Z",
    "blob_status": null,
    "set_completed_at": null,
    "public": false,
    "account_id": 105726,
    "app_id": 78162,
    "blob_object_access": {
      "id": 10070416,
      "blob_id": 10070416,
      "expires": "2020-07-29T12:06:31Z",
      "object_access_type": "Write",
      "params": "https://api.quickblox.com/blobs/10070416/upload/?acl=authenticated-read&content_type=image%2Fjpeg&expires=2020-07-29%2012%3A06%3A31%20UTC&key=20456a9676674f4ca950d963dfca630e00&policy=OTVhNDNiZDNiMWMxMGZlNDgzMmE1MzEyYzE4MjYyZjI%3D%0A&success_action_status=201&x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=d9edd8e29a9f029549ecf6313c67c676%2F20200729%2Fqbprod%2Fs3%2Faws4_request&x-amz-date=2020211T1206Z&x-amz-signature=84901614d08e3d2d1fbba76dc5378242"
    }
  }
}

Body Parameters

blob
object
required

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.

Responses

A successful response
blob
object
An error response
errors
object
curl -X POST \
-H "Content-Type: application/json" \
-H "QB-Token: 2e80acd7f3d9c1e79312e0d1dafd6691ba012bba" \
-d '{  
  "blob":{  
    "content_type":"image/jpeg",
    "name":"museum.jpeg"
  }
}' \
https://api.quickblox.com/blobs.json
{
  "blob": {
    "id": 10070416,
    "uid": "20456a9676674f4ca950d963dfca630e00",
    "content_type": "image/jpeg",
    "name": "test2.jpg",
    "size": null,
    "created_at": "2020-07-29T11:06:31Z",
    "updated_at": "2020-07-29T11:06:31Z",
    "blob_status": null,
    "set_completed_at": null,
    "public": false,
    "account_id": 105726,
    "app_id": 78162,
    "blob_object_access": {
      "id": 10070416,
      "blob_id": 10070416,
      "expires": "2020-07-29T12:06:31Z",
      "object_access_type": "Write",
      "params": "https://api.quickblox.com/blobs/10070416/upload/?acl=authenticated-read&content_type=image%2Fjpeg&expires=2020-07-29%2012%3A06%3A31%20UTC&key=20456a9676674f4ca950d963dfca630e00&policy=OTVhNDNiZDNiMWMxMGZlNDgzMmE1MzEyYzE4MjYyZjI%3D%0A&success_action_status=201&x-amz-algorithm=AWS4-HMAC-SHA256&x-amz-credential=d9edd8e29a9f029549ecf6313c67c676%2F20200729%2Fqbprod%2Fs3%2Faws4_request&x-amz-date=2020211T1206Z&x-amz-signature=84901614d08e3d2d1fbba76dc5378242"
    }
  }
}
I