A user motive is an image uploaded by an end customer into their own private motive library, for use in their designs.

Unlike the shop's built-in motive catalog (the Motive resource), this library is scoped to the calling customer. Entries are keyed by a customer key derived from the request: a temporary, per-session library, or a permanent library identified by a customer key. An uploaded motive is referenced by its returned id when it is placed in a design.

GET /accounts/{accountId}/shops/{shopId}/userMotives

List the motives in the customer's private library. Returns a paginated list of the motives uploaded by the calling customer.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
shopId required path   int the unique identifier of the shop
page query 0 int zero-based page index
size query 10 int number of items per page
Response Codes
Code Condition
200 paginated list of the customer's motives
Response Body
Media Type Data Type Description
application/json PagedData
application/xml PagedData
Response (XML)
<pagedData>
  <records>...</records>
  <totalElements>...</totalElements>
</pagedData>
Response (JSON)
{
  "pagedData" : {
    "records" : [ { }, { } ],
    "totalElements" : 12345
  }
}
GET /accounts/{accountId}/shops/{shopId}/userMotives/{motiveId}

Get a single user motive by its id.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
motiveId required path   int the unique identifier of the motive
shopId required path   int the unique identifier of the shop
Response Codes
Code Condition
200 the motive was successfully retrieved
404 motive not found for the given id
Response Body
Media Type Data Type Description
application/json Motive
application/xml Motive
Response (XML)
<motive>
  <id>...</id>
  <uuid>...</uuid>
  <name>funny thing</name>
  <type>VECTOR</type>
</motive>
Response (JSON)
{
  "motive" : {
    "id" : 12345,
    "uuid" : "...",
    "name" : "funny thing",
    "type" : "VECTOR"
  }
}
DELETE /accounts/{accountId}/shops/{shopId}/userMotives/{motiveId}

Delete a motive from the customer's private library. Removes the motive from the calling customer's library.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
motiveId required path   int the unique identifier of the motive to delete
shopId required path   int the unique identifier of the shop
Response Codes
Code Condition
204 the motive was deleted successfully; no response body
404 motive not found in the customer's library for the given id
Response Body
Media Type Data Type Description
application/json object
application/xml anyType
POST /accounts/{accountId}/shops/{shopId}/userMotives/createFromData

Upload a motive to the customer's private library from a URL or inline data. Supply the image either as a public url the platform downloads, or as base64-encoded attachment bytes, together with a filename. The motive is stored in the calling customer's library and returned.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
shopId required path   int the unique identifier of the shop
Request Body
Media Type Data Type Description
application/json UserMotiveUpload the upload payload: either url or attachment, plus filename
application/xml UserMotiveUpload
Response Codes
Code Condition
200 the motive was uploaded and stored in the customer's library
Response Body
Media Type Data Type Description
application/json Motive
application/xml Motive
Request (XML)
<userMotiveUpload>
  <attachment>...</attachment>
  <filename>...</filename>
  <url>...</url>
</userMotiveUpload>
Request (JSON)
{
  "userMotiveUpload" : {
    "attachment" : "...",
    "filename" : "...",
    "url" : "..."
  }
}
Response (XML)
<motive>
  <id>...</id>
  <uuid>...</uuid>
  <name>funny thing</name>
  <type>VECTOR</type>
</motive>
Response (JSON)
{
  "motive" : {
    "id" : 12345,
    "uuid" : "...",
    "name" : "funny thing",
    "type" : "VECTOR"
  }
}
POST /accounts/{accountId}/shops/{shopId}/userMotives/createFromMultipartForm

Upload a motive to the customer's private library via a multipart form. The image bytes must be sent as multipart/form-data in the uploadedFile form field; an optional name field carries the file name. The motive is stored in the calling customer's library and returned.

Parameters
Name In Default Constraints Description
x-auth-token header     The authentication token
accountId required path   int the unique identifier of the account
shopId required path   int the unique identifier of the shop
Request Body
Media Type Data Type Description
multipart/form-data (custom) the multipart form containing the image file in uploadedFile
Response Codes
Code Condition
200 the motive was uploaded and stored in the customer's library
400 no file content was supplied
Response Body
Media Type Data Type Description
application/json Motive
application/xml Motive
Response (XML)
<motive>
  <id>...</id>
  <uuid>...</uuid>
  <name>funny thing</name>
  <type>VECTOR</type>
</motive>
Response (JSON)
{
  "motive" : {
    "id" : 12345,
    "uuid" : "...",
    "name" : "funny thing",
    "type" : "VECTOR"
  }
}