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.


PUT/v3/blob

Start Blob Upload

Start a blob upload session

Body parameters

  • 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

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
    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
    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
    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 Request
application/json

PUT
/v3/blob
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 Response
application/json

{
  "success": true,
  "data": {
    "id": "id"
  }
}

POST/v3/blob/:id/:index

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

  • Name
    checksum
    Type
    string
    Description
    a checksum for the chunk
  • Name
    chunk
    Type
    string Required
    Description
    a chunk encoded as Base64

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
    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
    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
    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 Request
application/json

POST
/v3/blob/:id/:index
curl https://api.shopmonkey.cloud/v3/blob/ID/INDEX \ 
  -H "Authorization: Bearer ${SM_TOKEN}" \ 
  -X POST -H 'Content-Type: application/json' \ 
  --data '{ "chunk" : "value" }'

Example Response
application/json

{
  "success": true
}

PUT/v3/blob/:id

Complete Blob Session

Signal all chunks have been sent

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the blob identifier

Body parameters

  • Name
    count
    Type
    number Required
    Description
    the total number of chunks sent

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
    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
    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
    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 Request
application/json

PUT
/v3/blob/:id
curl https://api.shopmonkey.cloud/v3/blob/ID \ 
  -H "Authorization: Bearer ${SM_TOKEN}" \ 
  -X PUT -H 'Content-Type: application/json' \ 
  --data '{ "count" : 0 }'

Example Response
application/json

{
  "success": true
}

GET/v3/blob/:id

Download Blob

Download a Blob

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the blob identifier

200 Response

the content of the uploaded blob based on its contentType

Example Request

GET
/v3/blob/:id
curl https://api.shopmonkey.cloud/v3/blob/ID \ 
  -H "Authorization: Bearer ${SM_TOKEN}"

GET/v3/order_shared/:publicId/blob/:id

Download Blob

Download a Blob

URL parameters

  • Name
    id
    Type
    string Required
    Description
    the blob identifier

200 Response

the content of the uploaded blob based on its contentType

Example Request

GET
/v3/order_shared/:publicId/blob/:id
curl https://api.shopmonkey.cloud/v3/order_shared/PUBLICID/blob/ID \ 
  -H "Authorization: Bearer ${SM_TOKEN}"