POST api.kinja.com/api/core/typedtag/schema
{
"schemaId" : 100,
"schema": {
"A": {
"B" : {
"C" : {}
}
},
"D": {}
}
}
GET api.kinja.com/api/core/typedtag/schema?schemaId=100
POST api.kinja.com/api/core/typedtag/validate
post body:
{
"schemaId" : 100,
"typedTags" : [
{
"tagType": "A",
"tagValue": "foo"
},
{
"tagType": "B",
"tagValue": "bar"
},
{
"tagType": "C",
"tagValue": "foobar"
},
{
"tagType": "D",
"tagValue": "baz"
}
]
}
response:
{
"meta": {
"error": null,
"warnings": []
},
"data": true
}
note that not all tags are defined, but if a tag is specified, all ancestors are also specified
post body:
{
"schemaId" : 100,
"typedTags" : [
{
"tagType": "A",
"tagValue": "foo"
},
{
"tagType": "B",
"tagValue": "bar"
}
]
}
response:
{
"meta": {
"error": null,
"warnings": []
},
"data": true
}
post body:
{
"schemaId" : 100,
"typedTags" : [
{
"tagType": "C",
"tagValue": "foobar"
},
{
"tagType": "D",
"tagValue": "baz"
}
]
}
response:
{
"meta": {
"error": null,
"warnings": [
{
"message": "Tags with types A, B are missing from the provided tag set. These tags are required because they are ancestors of the tag: C.",
"code": "MISSING_TYPED_TAG"
}
]
},
"data": false
}
post body:
{
"schemaId" : 100,
"typedTags" : [
{
"tagType": "B",
"tagValue": "bar"
},
{
"tagType": "C",
"tagValue": "foobar"
},
{
"tagType": "D",
"tagValue": "baz"
}
]
}
response:
{
"meta": {
"error": null,
"warnings": [
{
"message": "Tags with types A are missing from the provided tag set. These tags are required because they are ancestors of the tag: B.",
"code": "MISSING_TYPED_TAG"
},
{
"message": "Tags with types A are missing from the provided tag set. These tags are required because they are ancestors of the tag: C.",
"code": "MISSING_TYPED_TAG"
}
]
},
"data": false
}
post body:
{
"schemaId" : 100,
"typedTags" : [
{
"tagType": "X",
"tagValue": "bar"
},
{
"tagType": "C",
"tagValue": "foobar"
},
{
"tagType": "D",
"tagValue": "baz"
}
]
}
response:
{
"meta": {
"error": null,
"warnings": [
{
"message": "Unknown tag type: X.",
"code": "UNKNOWN_TAG_TYPE"
},
{
"message": "Tags with types A, B are missing from the provided tag set. These tags are required because they are ancestors of the tag: C.",
"code": "MISSING_TYPED_TAG"
}
]
},
"data": false
}
post body:
{
"schemaId" : 99,
"typedTags" : [
{
"tagType": "X",
"tagValue": "bar"
}
]
}
response:
{
"meta": {
"error": {
"message": "Schema for id 99 does not exist",
"code": "TYPED_TAG_SCHEMA_NOT_FOUND",
"uid": "kinja-core-ecac642a-5246-4060-9254-2c99eeed5eb0"
},
"warnings": []
}
}
POST api.kinja.com/api/core/typedtag/save
{
"postId" : 200,
"schemaId" : 100,
"typedTags" : [
{
"tagType": "A",
"tagValue": "foo"
},
{
"tagType": "B",
"tagValue": "bar"
}
]
}
GET api.kinja.com/api/core/typedtag/tags?postId=200
response:
{
"meta": {
"error": null,
"warnings": []
},
"data": [
{
"tagType": "A",
"tagValue": "foo"
},
{
"tagType": "B",
"tagValue": "bar"
}
]
}
GET api.kinja.com/api/core/typedtag/posts?schemaId=101&paths=series:gameofthrones
response:
{
"meta": {
"error": null,
"warnings": []
},
"data": [
300,
305,
309,
312
]
}
GET api.kinja.com/api/core/typedtag/posts?schemaId=101&paths=series:gameofthrones|season:2
GET api.kinja.com/api/core/typedtag/posts?schemaId=101&paths=series:gameofthrones|season:2&paths=series:gameofthrones|season:3
GET api.kinja.com/api/core/typedtag/posts?schemaId=101&paths=series:gameofthrones&paths=series:breakingbad
GET api.kinja.com/api/core/typedtag/posts?schemaId=101&paths=series:gameofthrones|season:2&paths=series:breakingbad|season:4