Ecommerce: Meta Fields
GET /shops/{shopId}/meta-fields
Sending GET request to this url, returns collection of META FIELD resources that belong to given shop.
You can narrow down list of resources by passing proper query parameters (list of which you can find below in request params section). You can basically search by:
- name
- value
- description
- createdOn
You can specify which page of results you want and how many results per page should be there. You can also specify sort-order using one or more of allowed fields (listed below in request params section).
Last but not least you can even specify which fields from resource you want to get. If you pass param `fields` with list of fields (separated by comma [,]) we will return list of resources with only those fields (we will always add resource id to ensure that you can use that data later on)
Returns status code
200
Request url
/shops/p/meta-fields?query[name]=lorem&query[value]=ipsum&query[description]=lorem-ipsum&query[createdOn][from]=2010-10-13&query[createdOn][to]=2020-03-15
Request params
Field name | Field type | Field description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
query | hash | Used to search only resources that meets criteria. You can specify multiple parameters, then it uses AND logic.
| |||||||||||||||
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated with comma | |||||||||||||||
sort | hash | Enable sorting using specified field (set as a key) and order (set as a value). You can specify multiple fields to sort by.
| |||||||||||||||
perPage | int | Number results on page | |||||||||||||||
page | int | Page number |
Example Response
[
{
"metaFieldId": "V",
"name": "abcdef",
"description": "defghi",
"value": "ghijkl",
"valueType": "string",
"href": "https://api.getresponse.com/v3/shops/V/meta-fields/V",
"createdOn": "2017-04-05T09:19:40+0000",
"updatedOn": "2017-04-05T09:19:40+0000"
}
]
Possible Errors
GET /shops/{shopId}/meta-fields/{metaFieldId}
Method returns META FIELD with given metaFieldId in context of given shopId
Returns status code
200
Request url
/shops/p/meta-fields/V
Request params
Field name | Field type | Field description |
---|---|---|
fields | string | List of fields that should be returned. Id is always returned. Fields should be separated with comma |
Example Response
{
"metaFieldId": "V",
"name": "abcdef",
"description": "defghi",
"value": "ghijkl",
"valueType": "string",
"href": "https://api.getresponse.com/v3/shops/V/meta-fields/V",
"createdOn": "2017-04-05T09:19:40+0000",
"updatedOn": "2017-04-05T09:19:40+0000"
}
Possible Errors
POST /shops/{shopId}/meta-fields
Sending a POST request to this url, will create a new META FIELD resource.
In order to create a new META FIELD, you need to send META FIELD resource in BODY of the request (remember that you need to serialize body into JSON string)
Returns status code
201
Example Request Body
{
"name": "abcdef",
"description": "defghi",
"value": "ghijkl",
"valueType": "string"
}
Body params
Field name | Field type | Field description |
---|---|---|
name (required) | string | Name of the meta field, from 3 to 32 characters |
description | string | Description of the meta field, maximum 255 characters |
value (required) | string | Meta field value, maximum 65000 characters |
valueType (required) | string | Value type enumerable, accepts: string, integer |
Example Response
{
"metaFieldId": "V",
"name": "abcdef",
"description": "defghi",
"value": "ghijkl",
"valueType": "string",
"href": "https://api.getresponse.com/v3/shops/V/meta-fields/V",
"createdOn": "2017-04-05T09:19:40+0000",
"updatedOn": "2017-04-05T09:19:40+0000"
}
Possible Errors
POST /shops/{shopId}/meta-fields/{metaFieldId}
Update properties of shops META FIELD. You should send only those fields that need to be changed. The rest of properties will stay the same.
Returns status code
200
Example Request Body
{
"name": "abcdefghi",
"description": "defghijkl"
}
Body params
Field name | Field type | Field description |
---|---|---|
name | string | Name of the meta field, from 3 to 32 characters |
description | string | Description of the meta field, maximum 255 characters |
value | string | Meta field value, maximum 65000 characters |
valueType | string | Value type enumerable, accepts: string, integer |
Example Response
{
"metaFieldId": "V",
"name": "abcdefghi",
"description": "defghijkl",
"value": "ghijkl",
"valueType": "string",
"href": "https://api.getresponse.com/v3/shops/V/meta-fields/V",
"createdOn": "2017-04-05T09:19:40+0000",
"updatedOn": "2017-04-05T10:19:40+0000"
}