Skip to main content
GET
/
v1
/
metadata-schemas
/
{resource}
Get Metadata Schema
curl --request GET \
  --url https://{cluster}.voucherify.io/v1/metadata-schemas/{resource} \
  --header 'Authorization: Bearer <token>' \
  --header 'X-App-Id: <api-key>' \
  --header 'X-App-Token: <api-key>'
{
"id": "ms_27vMXZqBAkkqBoOuw8EYTRLn",
"related_object": "earning_rule",
"properties": {
"channel_id": {
"type": "string",
"array": true,
"optional": true,
"objectType": null,
"exactLength": 5
},
"channel_name": {
"eq": [
"instagram",
"facebook",
"google",
"twitter",
"linkedin",
"website"
],
"type": "string",
"array": false,
"optional": true,
"objectType": null
}
},
"allow_defined_only": false,
"created_at": "2022-08-25T13:09:59.970Z",
"updated_at": "2022-08-25T13:11:15.704Z",
"object": "metadata_schema"
}

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required
Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

resource
string
required

There is an infinite number of possibilities for retrieving metadata schemas by the resource type because you can define custom metadata schemas.

Response

The response does not include unknown metadata properties in the response, i.e. those that have been defined outside of the Project Settings > Metadata Schema definitions. For example, an unknown metadata property can be defined in the campaign manager.

Response body schema for GET /v1/metadata-schemas/{resource}. Object representing a metadata schema.

id
string
required

Unique identifier of the metadata schema.

The resource type. You can define custom metadata schemas, which have a custom "related_object" resource type. The standard metadata schemas are: "campaign", "customer", "earning_rule", "loyalty_tier", "order", "order_item", "product", "promotion_tier", "publication", "redemption", "reward", "voucher".

properties
object
required

Contains metadata definitions.

allow_defined_only
boolean | null
required

Restricts the creation of metadata fields when set to true. It indicates whether or not you can create new metadata definitions, e.g. in the campaign or publication manager. If set to true, then only the defined fields are available for assigning values.

created_at
string<date-time>
required

Timestamp representing the date and time when the metadata schema was created. The value for this parameter is shown in the ISO 8601 format.

Example:

"2021-12-03T13:33:44.556Z"

updated_at
string<date-time> | null
required

Timestamp representing the date and time when the metadata schema was updated. The value for this parameter is shown in the ISO 8601 format.

Example:

"2022-08-11T08:05:30.695Z"

object
string
default:metadata_schema
required

The type of the object represented by the JSON. This object stores information about the metadata schema.

I