CMS Categories API

All requests will use the post method and request URL https://cms.manage.aniview.com/backend/graphql

1. Get Categories List

Get a list of all Categories

Query:

query categories($order: [QueryCategoriesOrderByOrderByClause!], $first: Int!, $page: Int, $status: [String], $search: QueryCategoriesSearchWhereConditions) { categories( orderBy: $order search: $search status: $status first: $first page: $page ) { paginatorInfo { total count currentPage } data { id title videoAmount carouselAmount playlistAmount createdAt updatedAt status videos { id thumbnail { urlByDimensionKey(key: "small") } name createdAt updatedAt duration } carousels { title createdAt updatedAt slideDuration slideCount video { id name thumbnail { urlByDimensionKey(key: "small") } } } playlists { id name thumbnail { urlByDimensionKey(key: "small") } createdAt updatedAt duration } } } }

Query variables:

{ "first": 10, "order": [ { "column": "CREATED_AT", "order": "DESC" }, { "column": "ID", "order": "ASC" } ], "search": { "OR": [ { "column": "TITLE", "value": null, "operator": "LIKE" }, { "column": "ID", "value": "" } ] }, "page": 1, "status": [ "active", "archived" ] }

Code Example:

const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "categories", "variables": { "first": 10, "order": [ { "column": "CREATED_AT", "order": "DESC" }, { "column": "ID", "order": "ASC" } ], "search": { "OR": [ { "column": "TITLE", "value": null, "operator": "LIKE" }, { "column": "ID", "value": "" } ] }, "page": 1, "status": [ "active", "archived" ] }, "query": "query categories($order: [QueryCategoriesOrderByOrderByClause!], $first: Int!, $page: Int, $status: [String], $search: QueryCategoriesSearchWhereConditions) {\n categories(\n orderBy: $order\n search: $search\n status: $status\n first: $first\n page: $page\n ) {\n paginatorInfo {\n total\n count\n currentPage\n }\n data {\n id\n title\n videoAmount\n carouselAmount\n playlistAmount\n createdAt\n updatedAt\n status\n videos {\n id\n thumbnail {\n urlByDimensionKey(key: \"small\")\n }\n name\n createdAt\n updatedAt\n duration\n }\n carousels {\n title\n createdAt\n updatedAt\n slideDuration\n slideCount\n video {\n id\n name\n thumbnail {\n urlByDimensionKey(key: \"small\")\n }\n }\n }\n playlists {\n id\n name\n thumbnail {\n urlByDimensionKey(key: \"small\")\n }\n createdAt\n updatedAt\n duration\n }\n }\n }\n}" } axios.post(url, { 'id': 'id', 'password': 'password', 'accountId': 'accountId' }) .then((response) => { apiCall(response.data); }, (error) => { console.log(error); }); function apiCall(auth) { axios({ url: 'https://cms.manage.aniview.com/backend/graphql/', method: 'post', headers: { 'Cookie': 'token=' + auth.data.token }, data: payload }).then((result) => { console.log(result.data[0]); }); }

2. Create Categorie

Create a new Categorie

Query:

Query variables:

Code Example:

3. Update Categorie

Update a specific Categorie

Query:

Query variables:

Code example:

4. Delete Categorie

Delete a specific Categorie

Query:

Query variables:

Code example: