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

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 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

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

POST
/v3/blob/:id/:index
curl https://api.shopmonkey.cloud/v3/blob/:id/:index \
  -H "Authorization: Bearer ${SM_TOKEN}" \
  -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

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 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
}

DELETE/v3/blob/:id

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

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

Example Response
application/json

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

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

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

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

GET/v3/shared/blob/:id

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

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