Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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

1. Get Videos List

Retrieves a list of all Vidoes in the network.

Query:

query videos($orderBy: [QueryVideosOrderByOrderByClause!], $search: QueryVideosSearchWhereConditions, $hasPlaylists: QueryVideosHasPlaylistsWhereHasConditions, $status: [String!], $first: Int = 10, $page: Int) {videos(orderBy: $orderByfirst: $firstpage: $pagesearch: $searchhasPlaylists: $hasPlaylistsstatus: $status) {paginatorInfo {totalcountcurrentPagehasMorePages}data {nameiddurationcreatedAtupdatedAtuploadMethodstatusdescriptionisRegisterOnlysizesizeInPlayerflavors {encodingProgress}history {errorMessagedlTotalSizedlSizeSoFaruploadIndexuploadProgressprocessManagement {id}}thumbnail {urlByDimensionKey(key: "small")status}poster {status}}}}

Query variables:

{"first": 10,"orderBy": [{"column": "UPDATED_AT","order": "DESC"},{"column": "ID","order": "ASC"}],"search": {"OR": [{"column": "NAME","value": null,"operator": "LIKE"},{"column": "ID","value": ""}],"AND": []},"status": ["active","generating","error","archived"]}

Code Example:

const axios = require("axios");

const url = 'https://manage.aniview.com/api/token?format=json';
const payload = {
    "operationName": "videos",
    "variables": {
        "first": 10,
        "orderBy": [
            {
                "column": "UPDATED_AT",
                "order": "DESC"
            },
            {
                "column": "ID",
                "order": "ASC"
            }
        ],
        "search": {
            "OR": [
                {
                    "column": "NAME",
                    "value": null,
                    "operator": "LIKE"
                },
                {
                    "column": "ID",
                    "value": ""
                }
            ],
            "AND": []
        },
        "status": [
            "active",
            "generating",
            "error",
            "archived"
        ],
        "page": 1
    },
    "query": "query videos($orderBy: [QueryVideosOrderByOrderByClause!], $search: QueryVideosSearchWhereConditions, $hasPlaylists: QueryVideosHasPlaylistsWhereHasConditions, $status: [String!], $first: Int = 10, $page: Int) {\n  videos(\n    orderBy: $orderBy\n    first: $first\n    page: $page\n    search: $search\n    hasPlaylists: $hasPlaylists\n    status: $status\n  ) {\n    paginatorInfo {\n      total\n      count\n      currentPage\n      hasMorePages\n    }\n    data {\n      name\n      id\n      duration\n      createdAt\n      updatedAt\n      uploadMethod\n      status\n      description\n      isRegisterOnly\n      size\n      sizeInPlayer\n      flavors {\n        encodingProgress\n      }\n      history {\n        errorMessage\n        dlTotalSize\n        dlSizeSoFar\n        uploadIndex\n        uploadProgress\n        processManagement {\n          id\n        }\n      }\n      thumbnail {\n        urlByDimensionKey(key: \"small\")\n        status\n      }\n      poster {\n        status\n      }\n    }\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]);
    });
}

2. Register Videos (not uploading)

Register a video to Aniview. For users that would like to store videos on their own CDN.

Query:

"query": "mutation registerLinks($input: InputLinks!) {\n  registerLinks(input: $input) {\n    id\n  }\n}"

Query variables:

"variables": { "input": { "links": [ "https://play.aniview.com/6124992a9c738f3419721fb3/613f5950b41dd2740e4a5bd3/pexels4.mp4" ] } }

Code Example:

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. Update Video

Update a specific video

Query:

    "query": "mutation updateVideo($input: UpdateVideoInput!) {\n  updateVideo(input: $input) {\n    id\n  }\n}"

Query variables:

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

Code example:

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]);
    });
}

3. Delete Video

Update a specific video

Query:

    "query": "mutation updateVideo($input: UpdateVideoInput!) {\n  updateVideo(input: $input) {\n    id\n  }\n}"

Query variables:

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

Code example:

  • No labels