...
Code Block |
---|
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "registerLinks", "variables": { "input": { "links": [ "https://play.aniview.com/6124992a9c738f3419721fb3/613f5950b41dd2740e4a5bd3/pexels4.mp4" ] } }, "query": "mutation registerLinks($input: InputLinks!) {\n registerLinks(input: $input) {\n id\n }\n}" } axios.post(url, { 'id': 'email', 'password': 'password', 'accountId': 'publisherID' }) .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. Importing Videos (By Links)
Upload videos to the CMS that will be stored on the AniView CDN.
Query:
Code Block |
---|
"query": "mutation uploadByLinks($input: InputLinks!) { uploadLinks(input: $input) { id } }" |
Query variables:
Code Block |
---|
"variables": { "input": { "links": [ "https://play.aniview.com/6124992a9c738f3419721fb3/613f580f41489d6aab6fa507/pexels2.mp4" ] } } |
Code Example:
Code Block |
---|
const axios = require("axios");
const url = 'https://manage.aniview.com/api/token?format=json';
const payload = {
"operationName": "uploadByLinks",
"variables": {
"input": {
"links": [
"https://play.aniview.com/6124992a9c738f3419721fb3/613f580f41489d6aab6fa507/pexels2.mp4"
]
}
},
"query": "mutation uploadByLinks($input: InputLinks!) {\n uploadLinks(input: $input) {\n id\n }\n}"
}
axios.post(url, {
'id': 'email',
'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. Update Video
Update a specific video
Query:
...
Code Block |
---|
const axios = require("axios"); const url = 'https://manage.aniview.com/api/token?format=json'; const payload = { "operationName": "updateVideo", "variables": { "input": { "id": "62f241eea0f37003bc0f98e2", "name": "Title", "playerTag": "62f21de8d83dc72eea644d74", "description": "Description", "iabCategory": "IAB1-3", "clickThroughUrl": "https://www.walla.co.il/" } }, "query": "mutation updateVideo($input: UpdateVideoInput!) {\n updateVideo(input: $input) {\n id\n }\n}" } axios.post(url, { 'id': 'email', '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]); }); } |
...
5. Delete Video
Update a specific video
Query:
...