Create a resource
POST ~/resources
Headers
Field | Type | Description |
---|---|---|
Content-Type | String |
application/json |
Parameters
Field | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
name | String |
The human-readable name of the resource |
||||||
mimeType | String |
The mime type of the resource being created |
||||||
type | String |
Indicates how the resource is stored and retrieved.
|
||||||
context | String |
A free-text string to describe the purpose of the resource, e.g logo, user manual, etc |
||||||
privateoptional | boolean |
Indicating whether or not associated venues can access this resource. Default is |
||||||
resourceoptional | String |
This property is only allowed if the |
||||||
relations | Object |
An object describing each of the entity relationships for this resource. For example, a generic logo could be used by multiple locations, rather than each location having a duplicate image |
||||||
locationsoptional | String[] |
A list of hashed location IDs. See Hashed Location IDs |
||||||
appsoptional | String[] |
A list of App IDs. For Partners, this could only be a list of one. |
Response Headers
Field | Type | Description |
---|---|---|
ETag | String |
Contains the latest version of the resource. This value can then be sent on subsequent GET requests to check if the resource has changed. |
Response
Field | Type | Description |
---|---|---|
id | String |
Resource id in Doshii |
uploadUri | String |
The URI to use to upload the binary content associated to this resource. This property will not be present if the |
createdAt | String |
Date when the resource was created |
Examples
Request: Create a new resource hosted by Doshii
{
"name": "logo.png",
"mimeType": "image/png",
"context": "logo",
"type": "doshii-uri",
"private": false,
"relations": {
"apps": [123],
"locations": ["2X3b8q"]
}
}
Response
{
"id":"lLf2X0k6",
"uploadUri":"https://sandbox.app.doshii.co/v3/resources/lLf2X0k6",
"createdAt": "2018-08-24T04:58:38.485Z"
}
Request: Create a new resource externally hosted
{
"name": "logo.png",
"mimeType": "image/png",
"context": "logo",
"type": "external-uri",
"resource": "https://some.external.host/images/logo.png",
"private": false,
"relations": {
"apps": [123],
"locations": ["2X3b8q"]
}
}
Response
{
"id":"lLf2X0k6",
"createdAt": "2018-08-24T04:58:38.485Z"
}
Comments
0 comments
Please sign in to leave a comment.