Add/Update Resource

Add or update (if any resource with given resource guid is found) the posted resource.

URL:

POST http://api.aurelon.com/api/v2/resource

Request Headers:

Content-Type : multipart/form-data
MisKey : see Authentication
HardwareHash : see Authentication
SerialNumber : see Authentication
ApplicationVersion : see Authentication
Timestamp : ISO format UTC time

The modification date/time of the resource like “2018-11-01T08:41:34Z”. When the Timestamp is not provided than ‘now’ is assumed. The timestamp is compared against the timestamp of the resource in the cloud store. Only newer resources are accepted.

Request Body:

Form data 1: required

  • Name: JsonString
  • Content-Type: application/json
  • JSON object containing:
    • ResourceGUID – required – the Resource GUID
    • ResourceChecksum – required – SHA1 checksum of the resource in upper-case format
    • ResourceType – required
      • the type of the resource
      • known resource type: “NormalProfile”, “DefectProfile”, “FotobaMarks”, “Label”, “ColorMapping”,“Template”, “LayoutTemplate”, “Library”, “Preview” resource type can be a custom value
      • if resource type is not specify the resource type is set as “Generic”
    • Meta – JSON object containing the metadata about the resource
      • MediaType – required for “NormalProfile” – the Media tag from the PMM
      • ProfileGroup – required for “NormalProfile – the ProfileGroup tag from the PMM
      • Name – required

Form data 2: required

  • Name: Name of the resource, any name allowed
  • Content-Type: application/octet-stream
  • Binary content of the resource
  • Only one file accepted

Response:

Content type of the response is in JSON format

Success:

200 OK : “Resource successfully added”

Error:

  • 401 Unauthorised : {“Message”:”Invalid HardwareHash”}
  • 401 Unauthorised : {“Message”:”Invalid MisKey”}
  • 401 Unauthorised : {“Message”: “”MisKey” or “HardwareHash”, “SerialNumber” and “ApplicationVersion” header are required”}
  • 415 Unsupported Media Type : {“Message”:”This request is not properly formatted”}
  • 400 Bad Request : {“Message”:”No input file specified”}
  • 400 Bad Request : {“Message”:””ResourceGUID”, “ResourceChecksum” and “ResourceType” are required”}
  • 400 Bad Request : {“Message”:”Validation of Timestamp failed”}
  • 500 Internal Server Error : {“Message”:”Internal Server Error”}