Blob
The Blob object is used to describe a piece of content that is stored in the Shopmonkey Cloud. Typically, a Blob would be an attachment associated with a service, an inspection or some other piece of content that you upload.
Start Blob Upload
Start a blob upload session
Body parameters
Consumes
The following content type is required: application/json
- Name
count
- Type
- number Required
- Description
- the number of chunks that you will split the file by. recommended 1MB chunks
- Name
fileName
- Type
- string Required
- Description
- the filename
- Name
fileSize
- Type
- number Required
- Description
- the total size of the file
- Name
fileType
- Type
- string Required
- Description
- the mimetype for the file
Produces
The response content type: application/json
200
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if success = false
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
- Name
data
- Type
- object Required
- Description
Properties for data
object
- Name
id
- Type
- string Required
- Description
- the blob identifier
4xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
5xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
Example Requestapplication/json
curl https://api.shopmonkey.cloud/v3/blob \
-H "Authorization: Bearer ${SM_TOKEN}" \
-X PUT -H 'Content-Type: application/json' \
--data '{ "count" : 0, "fileName" : "value", "fileSize" : 0, "fileType" : "value" }'
Example Responseapplication/json
{
"success": true,
"data": {
"id": "id"
}
}
Upload Blob Chunk
Send a Blob chunk
URL parameters
- Name
id
- Type
- string Required
- Description
- the blob identifier
- Name
index
- Type
- number Required
- Description
- the index for a split blob starting at offset 0
Body parameters
Consumes
The following content type is required: application/json
- Name
checksum
- Type
- string
- Description
- a checksum for the chunk
- Name
chunk
- Type
- string Required
- Description
- a chunk encoded as Base64
Produces
The response content type: application/json
200
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if success = false
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
4xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
5xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
Example Requestapplication/json
curl https://api.shopmonkey.cloud/v3/blob/:id/:index \
-H "Authorization: Bearer ${SM_TOKEN}" \
-H 'Content-Type: application/json' \
--data '{ "chunk" : "value" }'
Example Responseapplication/json
{
"success": true
}
Complete Blob Session
Signal all chunks have been sent
URL parameters
- Name
id
- Type
- string Required
- Description
- the blob identifier
Body parameters
Consumes
The following content type is required: application/json
- Name
count
- Type
- number Required
- Description
- the total number of chunks sent
Produces
The response content type: application/json
200
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if success = false
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
4xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
5xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
Example Requestapplication/json
curl https://api.shopmonkey.cloud/v3/blob/:id \
-H "Authorization: Bearer ${SM_TOKEN}" \
-X PUT -H 'Content-Type: application/json' \
--data '{ "count" : 0 }'
Example Responseapplication/json
{
"success": true
}
Delete Blob
Delete a blob
URL parameters
- Name
id
- Type
- string Required
- Description
- the blob identifier
Produces
The response content type: application/json
200
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if success = false
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
- Name
data
- Type
- object Required
- Description
Properties for data
object
- Name
deleted
- Type
- boolean Required
- Description
- true if the blob was deleted
4xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
5xx
Response
- Name
code
- Type
- string
- Description
- The error code
- Name
data
- Type
- object
- Description
- An optional object containing relevant error data
- Name
documentation_url
- Type
- string
- Description
- An optional link to the documentation for the error
- Name
message
- Type
- string
- Description
- the error message if not successful
- Name
success
- Type
- boolean Required
- Description
- if successful, will be true. if not successful, will be false and message will contain a human readable error message
Example Requestapplication/json
curl https://api.shopmonkey.cloud/v3/blob/:id \
-H "Authorization: Bearer ${SM_TOKEN}" \
-X DELETE -H 'Content-Type: application/json' \
--data '{}'
Example Responseapplication/json
{
"success": true,
"data": {
"deleted": true
}
}
Download Blob
Download a Blob
URL parameters
- Name
id
- Type
- string Required
- Description
- the blob identifier
Query String parameters
- Name
inline
- Type
- boolean
- Description
- Name
transform
- Type
- string
- Description
- an optional transformation to apply to the blob
Produces
The response content type: */*
200
Response
the content of the uploaded blob based on its contentType
Example Request
curl https://api.shopmonkey.cloud/v3/order_shared/:publicId/blob/:id \
-H "Authorization: Bearer ${SM_TOKEN}"
Download Blob
Download a Blob
URL parameters
- Name
id
- Type
- string Required
- Description
- the blob identifier
Query String parameters
- Name
inline
- Type
- boolean
- Description
- Name
transform
- Type
- string
- Description
- an optional transformation to apply to the blob
Produces
The response content type: */*
200
Response
the content of the uploaded blob based on its contentType
Example Request
curl https://api.shopmonkey.cloud/v3/shared/blob/:id \
-H "Authorization: Bearer ${SM_TOKEN}"