Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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 updateVideouploadByLinks($input: UpdateVideoInputInputLinks!) {\n  updateVideouploadLinks(input: $input) {\n    id\n } }\n}"

Query variables:

Code Block
"variables": { "input": { "idlinks": "62f241eea0f37003bc0f98e2",[ "name": "Title", "playerTag": "62f21de8d83dc72eea644d74", "description": "Description", "iabCategory": "IAB1-3", "clickThroughUrl": "https://www.walla.co.il/" } }

Code example:

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",
  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
    "query": "mutation updateVideo($input: UpdateVideoInput!) {\n  updateVideo(input: $input) {\n    id\n  }\n}"

Query variables:

Code Block
"variables": { "input": { "id": "62f241eea0f37003bc0f98e2", "name": "Title", "playerTag": "62f21de8d83dc72eea644d74", "description": "Description", "iabCategory": "IAB1-3", "clickThroughUrl": "https://www.walla.co.il/" } }

Code example:

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:

Code Block
"query": "mutation archiveVideo($ids: [ID!]!, $force: Boolean) {\n  archiveVideo(ids: $ids, force: $force) {\n    id\n  }\n}"

Query variables:

Code Block
"variables": { "ids": [ "62f241eea0f37003bc0f98e2" ], "force": false }

Code example:

Code Block
const axios = require("axios");

const url = 'https://manage.aniview.com/api/token?format=json';
const payload = {
    "operationName": "archiveVideo",
    "variables": {
         "iabCategoryids": "IAB1-3",[
            "clickThroughUrl": "https://www.walla.co.il/"62f241eea0f37003bc0f98e2"
        ],
        }"force": false
    },
    "query": "mutation updateVideoarchiveVideo($input$ids: UpdateVideoInput![ID!]!, $force: Boolean) {\n  updateVideo(inputarchiveVideo(ids: $ids, force: $input$force) {\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: {
  
        url: 'Cookie': 'token=' + auth.data.tokenhttps://cms.manage.aniview.com/backend/graphql/',
          }method: 'post',
        data: payload
    }).then((result) => {
 headers: {
      console.log(result.data[0]);      'Cookie':  });
}

3. Delete Video

Update a specific video

Query:

Code Block
'token=' + auth.data.token
     "query": "mutation updateVideo($input: UpdateVideoInput!) {\n  updateVideo(input: $input) {\n },
        id\ndata:  }\n}"

Query variables:

Code Block
"variables": { "input": { "id": "62f241eea0f37003bc0f98e2", "name": "Title", "playerTag": "62f21de8d83dc72eea644d74", "description": "Description", "iabCategory": "IAB1-3", "clickThroughUrl": "https://www.walla.co.il/" } }

...

payload
    }).then((result) => {
        console.log(result.data[0]);
    });
}