Skip to end of metadata
Go to start of metadata

 

Retrieve a Schema

This method is used to get a specific schema.

 

 

Method

GET

 

 

 

 

Headers

In order to provide CME with the JWT, you must provide a header named Authorization and the token must be prefixed with the word Bearer.

Key

Authorization

Value

Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpZCI6MTY3NCwiZW1haWwiOiJvcmdvd25lckBjeWJhZ2UuY29tIiwiZmlyc3RfbmFtZSI6IkN5YmFnZSIsImxhc3RfbmFtZSI6Ik9yZyBPd25lciIsIm9yZ3MiOltdLCJzZXNzaW9uX2lkIjoiNzk3ZWRjNmY2Mjk5Y2JmYmEyODE3NDlhMGFlZjI0YmNhNmZmODM0NSIsIm9yZ19pZCI6NTEsIm9yZ19uYW1lIjoiQ3liYWdlIENsZWFuIiwiaWF0IjoxNDg4MjI5ODY0LCJleHAiOjE0ODgzMTYyNjR9.Vd7BCYEkeWOq2B3_3Np9ylYDwYaAWyE1-e4ZvCIvK4E

 

 

Request Parameters

None

 

 

Example Request

GET
https://cms-api.phunware.com/v2.0/schemas/587f99bdb2740a466376637f

 

 

Response Parameters

Parameter

Value

Description

idstringSystem-assigned schema identifier

orgId

integerSystem-assigned identifier for the org entity that owns the schema records.
name
stringThe name of the schema. We recommend a unique string to help differentiate this schema from other schemas.
descriptionstringDescription of the schema.
tagsarray

An array containing the list of tags (string). Tags are useful for organizing the containers into groups.

attributesobject

An array of static key / value pairs that will be merged with the dynamic schema field content.

fieldsarray

An array of objects, where each object is a field definition. The possible keys for each object are:

Field
Type
Description
attributesobject

Contains the field-specific attributes. For example, when the type is "selectSingle", this will contain a key / value pair where the key is "options" and the value is an object of value / label pairs. Possible values depend on the type: 

  • options (object): A key / value pair where the key is the option value and the value is the option label. Used for the following types: selectSingle, selectMulti.

descriptionstringAn optional description to describe the usage of this field
fieldstringA unique key to reference this field by
 isRequiredBoolean

Specifies whether this field is required. Default value: false

 isTitleKey BooleanSpecifies whether this field should be used as the title. Default value: false
labelstringThe label used for display purposes
typestringSpecifies the type of field.  
validationsobject

An object containing the validation rules. Possible values depend on the type: 

Field
Type
Description
length(integer|objectIf an integer is specified, then the value must be exactly that length. If an object is specified, then one or both of the "min" and "max" keys must be specified. Used for the following types:
      • "textSingle"
      • "textMulti"
      • "htmlSingle"
      • "htmlMulti"
      • "selectMulti"
rangearrayAn object containing one or both of the "min" and "max" keys. Used for the following types:  
      • "textSingle"
      • "textMulti"
      • "htmlSingle"
      • "htmlMulti"
      • "selectMulti"
inarrayAn array of valid values. Used for the following types:  
      • "textSingle"
      • "number"
      • "integer"
      • "decimal"
      • "date"
      • "time"
      • "dateTime"
createAt
string
Date and time the schema record was created.
updatedAt
string
Date and time that the schema record was last updated.

 

 

Response

See CME API Response Handling for error payloads.

A successful response will have a 200 status code and a body containing an object with schema data.

{"data":
{ 
"id": <string>,
"orgId": <integer>,
"name": <string>,
"description": <string>,
"tags": 
[
<string>,
<string>,
...
],
"attributes": 
{
"<field1>": <value1>,
"<field2>": <value1>,
...
},
"fields": 
[
{
"field": <string>,
"label": <string>,
"type": <string>,
"isTitleKey": <Boolean>,
"isRequired": <Boolean>,
"description": <string>,
"validations": <object>
},
...
],
"createdAt": <string>,
"updatedAt": <string>
}
}

 

 

Example Response

 

{ "data": 
{
"id": "587f99bdb2740a466376637f",
"orgId": 51,
"name": "The Legend of Zelda",
"description": "Created by Sandman",
"tags": 
[
"Zelda"
],
"attributes": 
{
"Skyward Sword": Wii
},
"fields": 
[
{
"field": "Field 1",
"label": "Label 1",
"type": "number",
"isTitleKey": yes,
"isRequired": yes,
"description": "Description 1"
}
],
"createdAt": "1986-02-21T12:45:00Z",
"updatedAt": "2013-11-22T12:45:00Z"
}
}
  • No labels