All request will use the post method and request URL https://cms.manage.aniview.com/backend/graphql
1. Get Carousels List
Get list of all Carouselss
Query:
query carousels($order: [QueryCarouselsOrderByOrderByClause!], $search: QueryCarouselsSearchWhereConditions, $first: Int!, $page: Int!, $status: [String!]) { carousels( orderBy: $order first: $first page: $page search: $search status: $status ) { paginatorInfo { total count currentPage } data { id title duration createdAt updatedAt slideCount transitionFilter slideDuration progress feed { id title } status error video { thumbnail { urlByDimensionKey(key: "small") status } poster { status } } } } }
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": "" } ], "AND": [] }, "status": [ "active", "generating", "error", "archived", "importing", "transcoding", "encoding", "uploading" ], "page": 1 }
Code Example:
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "carousels", "variables": { "first": 10, "order": [ { "column": "CREATED_AT", "order": "DESC" }, { "column": "ID", "order": "ASC" } ], "search": { "OR": [ { "column": "TITLE", "value": null, "operator": "LIKE" }, { "column": "ID", "value": "" } ], "AND": [] }, "status": [ "active", "generating", "error", "archived", "importing", "transcoding", "encoding", "uploading" ], "page": 1 }, "query": "query carousels($order: [QueryCarouselsOrderByOrderByClause!], $search: QueryCarouselsSearchWhereConditions, $first: Int!, $page: Int!, $status: [String!]) {\n carousels(\n orderBy: $order\n first: $first\n page: $page\n search: $search\n status: $status\n ) {\n paginatorInfo {\n total\n count\n currentPage\n }\n data {\n id\n title\n duration\n createdAt\n updatedAt\n slideCount\n transitionFilter\n slideDuration\n progress\n feed {\n id\n title\n }\n status\n error\n video {\n thumbnail {\n urlByDimensionKey(key: \"small\")\n status\n }\n poster {\n status\n }\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 Carousels
Create a new Carousels
Query:
mutation createCarousel($input: CreateCarouselInput!) { createCarousel(input: $input) { id } }
Query variables:
{ "input": { "title": "Title", "feed": { "connect": "615420fc743c5e576b0cf002" }, "slideCount": 10, "slideDuration": 25000, "transitionFilter": "FADE", "slideAnimation": "RANDOM", "description": "Description", "allowClickThrough": true, "iabCategory": "IAB1" } }
Code Example:
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "createCarousel", "variables": { "input": { "title": "Title", "feed": { "connect": "615420fc743c5e576b0cf002" }, "slideCount": 10, "slideDuration": 25000, "transitionFilter": "FADE", "slideAnimation": "RANDOM", "description": "Description", "allowClickThrough": true, "iabCategory": "IAB1" } }, "query": "mutation createCarousel($input: CreateCarouselInput!) {\n createCarousel(input: $input) {\n id\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]); }); }
3. Update Carousels
Update a specific Carousels
Query:
mutation updateVideo($input: UpdateVideoInput!) { updateVideo(input: $input) { id } }
Query variables:
{ "input": { "id": "62b3ffe75c9d98927404c042" } }
Code example:
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "updateVideo", "variables": { "input": { "id": "62b3ffe75c9d98927404c042" } }, "query": "mutation updateVideo($input: UpdateVideoInput!) {\n updateVideo(input: $input) {\n id\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]); }); }
4. Delete Carousels
Delete a specific Carousels
Query:
mutation archiveCarousel($ids: [ID!]!) { archiveCarousel(ids: $ids) { id } }
Query variables:
{ "ids": [ "62a8f45e586fcf44c100cdf4" ] }
Code example:
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "archiveCarousel", "variables": { "ids": [ "62a8f45e586fcf44c100cdf4" ] }, "query": "mutation archiveCarousel($ids: [ID!]!) {\n archiveCarousel(ids: $ids) {\n id\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]); }); }