Developer

Working with Management API

Introduction

Management API is a secure API that provides read and write access to your Nimvio projects. Use Nimvio Management API to manage your contents, templates, and media.

Nimvio Management API is available in REST API and GraphQL. The base URL for all request to Management API is https://api.nimvio.com/cma/rest/v1 for REST API and https://api.nimvio.com/cma/graphql/v1 for GraphQL. Requests must be made securely over HTTPS and authenticated with a valid API Key.

 

Authorization

Management API uses an API Key to authorize the request. Send your requests over the HTTPS and authenticate using the Authorization header.

Put the generated key to the request header, such as Authorization: <key>, to be able to access Nimvio Management APIs. Requests with an incorrect or missing header will fail with an error.

You can authenticate requests with Management API Key generated from Nimvio Settings — On the Nimvio project level, go to Settings > API > Management API > Generate the API.

Demo to generate Management API Key in Nimvio Settings
https://media.nimvio.com/Project_c1457a00-729a-456c-841b-5c10710e8a18/Media/Resources/Guide/Working%20with%20Management%20API/demo_generate_management_api_token_published.webp

 

API Key Expiration

When creating or regenerating Management API Keys, you can define the expiration length.

 

Errors

Our API follows standard HTTP status code returns to indicate the success or failure of a request. In general, status code in 2xx range indicate the successful request, status code in 4xx range indicate errors caused by incorrect input (for example, receive 401 Unauthorized error as the request provides an invalid API Key), and status code 5xx range indicate errors on our side.

HTTP Status Codes Summary

StatusDescription
400 Bad RequestThe request couldn't be understood by our server. It might be there are missing or invalid parameters or queries.
401 UnauthorizedThe provided API key doesn't grant access to the requested resource. Please check again the API key.
403 ForbiddenThe provided API key is valid, but doesn't provide permission for the specific resource.
404 Not FoundThe requested resource doesn't exist. Please check the resource name for any typos.
405 Methods Not AllowedThe requested HTTP method is not supported for the specific resource.
429 Too Many RequestsThe rate limit for the API has been exceeded. Try to request again after a few seconds.
5xx Internal Error or Service UnavailableSomething went wrong on our side. Try to request again after a few seconds.

 

REST API

You can use this base URL https://api.nimvio.com/cma/rest/v1 when working with Management API via REST API. This URL is followed by parameters or queries as below to retrieve specific served data.

Content

GET Content List

Retrieve a dynamically paginated list of contents.

https://api.nimvio.com/cma/rest/v1/contents

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
PageNumber > 0
The page number of the content page.
Example: 1
PageSizeNumber > 0
The size of page.
Example: 10
SortString
The column name you want to sort. Please refer to the available keys of object from the content (such as Name, TemplateName, Status, etc.)
Example: Name
SortAscBoolean
The option to order your retrieved contents (ascending or descending). The default is to return the contents in ascending order.
QuickSearchString
Search contents based on their name.
ContentStatusArray of String
Filter list of contents based on their status (Published, Changed, or Unpublished).
TemplateNameArray of String
Search contents based on their template name.
ContentAuthorArray of String
Search contents based on their author.

 

Responses
SuccessFailed
{
    "contents"
: {
        "status": 200,
        "totalItems": 2,
        "lastEvaluatedKey"
null,
        "error": null,
        "data": [
            {
                "Name"
"TestCMCreateContent1",
                "TemplateName"
"RTE Test",
                "Status"
"Unpublished",
                "Data"
null,
                "CreatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T08:44:54.750Z",
                "PublishedAt"
"2023-02-22T07:50:16.787Z",
                "ParentID"
"Content",
                "ContentID"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "HasChild"
null,
                "Acl"
: {
                    "Edit"
"Allow",
                    "Delete"
"Allow",
                    "Administer"
"Allow"
                }
            },
            {
                "Name"
"TestCMCreateContent",
                "TemplateName"
"RTE Test",
                "Status"
"Unpublished",
                "Data"
null,
                "CreatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T06:41:36.717Z",
                "PublishedAt"
null,
                "ParentID"
"Content",
                "ContentID"
"Content_b19e60c6-78c1-4151-a3b8-8ac90b285802",
                "HasChild"
null,
                "Acl"
: {
                    "Edit"
"Allow",
                    "Delete"
"Allow",
                    "Administer"
"Allow"
                }
            }
        ]

    }
}
{
    "status": 500,
    "message": "Oops! Something went wrong...
"
}

 

GET Content

Retrieve a single object of content.

https://api.nimvio.com/cma/rest/v1/content

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
ItemIDString MANDATORY
The ID of your specific Content without any prefix. You can get this on the Content detail sidebar
Example: "f69cc50a-a134-4184-9c42-13f8e9372333"

 

Responses
Success{
    "content"
: {
        "status"
: 200,
        "error"null,
        "data": [
            {
                "ContentID": 
"Content_d64d1387-3799-4485-ac19-b856bc18cd2c",
                "ContentIDView"
"Content_d64d1387-3799-4485-ac19-b856bc18cd2c",
                "Name"
"Test2",
                "TemplateName"
"RTE Test",
                "TemplateID": 
"Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "Status"
"Published",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "CreatedAt"
"2023-02-22T02:38:15.283Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "PublishedAt"
"2023-02-22T02:38:48.229Z",
                "UpdatedAt"
"2023-02-22T02:38:48.229Z",
                "Data"
"{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}",
                "HasChild"
true,
                "Template"
: {
                    "Components"
"{\n  \"components\": [\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 0,\n      \"isSaved\": true,\n      \"tableView\": true,\n      \"label\": \"RTE Test\",\n      \"ID\": \"rteTest\",\n      \"type\": \"customRTE\",\n      \"key\": \"rteTest\"\n    },\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 1,\n      \"data\": {\n        \"categoryAssets\": [\n          \"Image\",\n          \"Document\",\n          \"Audio\",\n          \"Video\",\n          \"Folder\"\n        ],\n        \"category\": \"\",\n        \"canceledUpload\": [],\n        \"uploadedAssets\": [],\n        \"dropFiles\": []\n      },\n      \"isSaved\": true,\n      \"tableView\": false,\n      \"mediaPermissions\": {\n        \"create\": true,\n        \"read\": true\n      },\n      \"label\": \"Media\",\n      \"ID\": \"media\",\n      \"storage\": \"url\",\n      \"type\": \"assets\",\n      \"key\": \"media\",\n      \"url\": \"https://angular-file-upload-cors-srv.appspot.com/upload\"\n    }\n  ]\n}"
                },
                "Ancestors"
: [],
                "UnpublishedLinkedItems"
null
            },
        ]

    }
}
Failed{
    "status": 500,
    "message": "Oops! Something went wrong...
"
}

 

POST Create Content

Add new content to your list.

https://api.nimvio.com/cma/rest/v1/createContent

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and without the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
TemplateIDString MANDATORY
The ID of template used to create the content.
Example: "Template_f69cc50a-a134-4184-9c42-13f8e9372333"
ContentNameString MANDATORY
The name of newly created content.
Example: "Template_f69cc50a-a134-4184-9c42-13f8e9372333"
ParentIDString MANDATORY
The Content ID of parent of the content you want to put to. The default is Content.

 

Responses
SuccessFailed
{
    "createContent": {
        "status": 200,
        "totalItems": 1,
        "error": null,
        "data": [
            {
                "Name": "TestCMCreateContent-2",
                "Status": "Unpublished",
                "TemplateID": "Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "ContentID": "Content_e39a4822-64a9-46c8-8077-bd6a4452c7aa",
                "ParentID": "Content"
            }
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully created.",
        "lastEvaluatedKey": null
    }
}
{
    "status": 404,
    "message": "Failed to read content due to content is not found on the database.
"
}

 

POST Update Content

Edit or update the existing content.

https://api.nimvio.com/cma/rest/v1/updateContent

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and without the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
TemplateIDString MANDATORY
The ID of template used to create the content.
Example: "Template_f69cc50a-a134-4184-9c42-13f8e9372333"
ItemIDString MANDATORY
The Content ID and without the prefix Content_.
Example: "f3b8398d-6269-4e24-9a70-683dc38b2333"
DataString
The stringify data of your content.
Example: "{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}"
ContentNameString MANDATORY
The name of newly created content.
Example: "Template_f69cc50a-a134-4184-9c42-13f8e9372333"
ParentIDString MANDATORY
The ID of parent of the content you want to put to. The default value is Content.
Example: "Content_f69cc50a-a134-4184-9c42-13f8e9372333"

 

Responses
Success{
    "updateContent"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "ContentID"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "ContentIDView"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "Name"
"TestCMCreateContent1",
                "TemplateName"
"RTE Test",
                "TemplateID"
"Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "Status"
"Unpublished",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "CreatedAt"
"2023-02-22T06:51:07.582Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "PublishedAt"
"2023-02-22T07:50:16.787Z",
                "UpdatedAt"
"2023-03-21T08:59:29.115Z",
                "Data"
"{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}",
                "HasChild"
false,
                "Template"
: {
                    "Components"
"{\n  \"components\": [\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 0,\n      \"isSaved\": true,\n      \"tableView\": true,\n      \"label\": \"RTE Test\",\n      \"ID\": \"rteTest\",\n      \"type\": \"customRTE\",\n      \"key\": \"rteTest\"\n    },\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 1,\n      \"data\": {\n        \"categoryAssets\": [\n          \"Image\",\n          \"Document\",\n          \"Audio\",\n          \"Video\",\n          \"Folder\"\n        ],\n        \"category\": \"\",\n        \"canceledUpload\": [],\n        \"uploadedAssets\": [],\n        \"dropFiles\": []\n      },\n      \"isSaved\": true,\n      \"tableView\": false,\n      \"mediaPermissions\": {\n        \"create\": true,\n        \"read\": true\n      },\n      \"label\": \"Media\",\n      \"ID\": \"media\",\n      \"storage\": \"url\",\n      \"type\": \"assets\",\n      \"key\": \"media\",\n      \"url\": \"https://angular-file-upload-cors-srv.appspot.com/upload\"\n    }\n  ]\n}"
                },
                "Ancestors"
: [],
                "UnpublishedLinkedItems"
null
            }
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully updated.",
        "lastEvaluatedKey"
null
    }
}
Failed

{
    "status": 404,
    "message": "Failed to read content due to content is not found on the database.
"
}

 

POST Delete Content

Delete the existing content.

https://api.nimvio.com/cma/rest/v1/deleteContent

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and without the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
ItemIDString MANDATORY
The Content ID and without the prefix Content_.
Example: "e39a4822-64a9-46c8-8077-bd6a4452c333"

 

Responses
SuccessFailed
{
    "deleteContent"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "Name"
"TestCMCreateContent-2",
                "Status"
"Unpublished",
                "SearchName"
null,
                "ParentID"
"Content",
                "CreatedAt"
"2023-03-21T08:57:45.201Z",
                "UpdatedAt"
"2023-03-21T08:57:45.201Z",
                "ContentID"
"Content_e39a4822-64a9-46c8-8077-bd6a4452c7aa"
            },
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully deleted.",
        "lastEvaluatedKey"
null
    }
}
{
    "status": 422,
    "message": "Failed to delete content as this content still in use. Please refer to Used In section for the detail.
"
}

 

Template

GET Template List

Retrieve a dynamically paginated list of templates.

https://api.nimvio.com/cma/rest/v1/templates

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf333"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd333"
PageNumber > 0
The page number of the template page.
Example: 1
PageSizeNumber > 0
The size of page.
Example: 10
SortString
The column name you want to sort. Please refer to the available keys of object from the template (such as Name, TemplateAuthor, etc.)
Example: Name
SortAscBoolean
The option to order your retrieved contents (ascending or descending). The default is to return the contents in ascending order.
QuickSearchString
Search contents based on their name or author.
TemplateNameArray of String
Search templates based on their name.
TemplateAuthorArray of String
Search templates based on their author.

 

Responses
SuccessFailed
{
    "templates"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c",
                "Name"
"TempateTest1",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "TotalContent"
: 0,
                "UpdatedAt"
"2023-03-21T09:16:35.503Z",
                "WorkflowName"
""
            },
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_e1875a1f-7635-4a6a-9718-99c914fc35e0",
                "Name"
"TempateTest",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "TotalContent"
: 0,
                "UpdatedAt"
"2023-03-16T04:25:54.883Z",
                "WorkflowName"
""
            },
        ]

    }
}
{
    "status": 500,
    "message": "Oops! Something went wrong...
"
}

 

GET Template

Retrieve a single object data of a template.

https://api.nimvio.com/cma/rest/v1/template?EnvironmentID={{ EnvironmentID }}&TenantID={{ TenantID }}

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf532"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd121"
ItemIDString MANDATORY
The ID of your Template without prefix Template_.
Example: "21c5f80a-c9d4-4dfa-9873-a6d0071baa9d"

 

Responses
Success{
    "template"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {
                "Name"
"TemplateTest1",
                "Components"
"{\n    \"components\": [\n        {\n            \"input\": true,\n            \"templateFieldNumber\": 0,\n            \"isSaved\": true,\n            \"tableView\": true,\n            \"label\": \"Test\",\n            \"ID\": \"test\",\n            \"type\": \"textfield\",\n            \"showCharCount\": true,\n            \"isSlug\": false,\n            \"key\": \"test\"\n        }\n    ]\n}",
                "TenantID"
"Tenant_81ac23c3-9b27-4ed3-bc35-42c6ddbe9db1",
                "WorkflowID"
null
            }
        ]
    }
}
Failed

{
    "status": 500,
    "message": "Oops! Something went wrong...
"
}

 

POST Create Template

Create a new template.

https://api.nimvio.com/cma/rest/v1/createTemplate

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf216"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77gs341"
TemplateNameString
Put the name of your new template.
TemplateComponentsString
The stringify of the template components. You can see the scheme of the template component in Formio Builder.
Example: "{\"components\":[{\"label\":\"ID\",\"key\":\"id\",\"ID\":\"id\",\"isSlug\":false,\"type\":\"textfield\",\"showCharCount\":true,\"input\":true,\"tableView\":true,\"isSaved\":true}]}"

 

Responses
SuccessFailed
{
    "createTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {

                "Name""TempateTest1"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully created."
    }
}

{
   
"status": 422,
   "message": 
"Failed to create template due to the name already exists in the table. Please try again with the valid input."

}

 

POST Update Template

Edit or update an existing template.

https://api.nimvio.com/cma/rest/v1/updateTemplate

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf512"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd311"
ItemIDString MANDATORY
The ID of your Template without prefix Template_.
Example: "21c5f80a-c9d4-4dfa-9873-a6d0071cdc9d"
TemplateNameString
Put the name of your new template.
TemplateComponentsString
The stringify of the template components. You can see the scheme of the template component in Formio Builder.
Example: "{\"components\":[{\"label\":\"ID\",\"key\":\"id\",\"ID\":\"id\",\"isSlug\":false,\"type\":\"textfield\",\"showCharCount\":true,\"input\":true,\"tableView\":true,\"isSaved\":true}]}"
WorkflowIDString
The ID of Template Workflow.
RetainValueBoolean
The flag to determine whether the updated template will reset or retain data in Content(s) that use this updated template.

 

Responses
SuccessFailed
{
    "updateTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {

                "Name""TempateTest1"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully updated."
    }
}
{
   
"status": 422,
   "message": 
"Failed to update template due to the name already exists in the table. Please try again with the valid input."
}

 

POST Delete Template

Edit or update an existing template.

https://api.nimvio.com/cma/rest/v1/deleteTemplate

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf512"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd141"
ItemIDString
The ID of your Template without prefix Template_.
Example: "1dc957b4-e198-4692-afcb-97bf4099d970"

 

Responses
SuccessFailed
{
    "deleteTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c",
                "Name"
"TempateTest1",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-03-21T09:16:35.503Z"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully deleted.",
        "lastEvaluatedKey"
null
    }
}

{
   
"status": 422,
   "message": 
"Failed to delete template due to the name already exists in the table. Please try again with the valid input."
}

 

Media

GET Media List

Retrieve a dynamically paginated list of media.

https://api.nimvio.com/cma/rest/v1/mediaList

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf446"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77f1341"
PageNumber > 0
The page number of the template page.
Example: 1
PageSizeNumber > 0
The size of page.
Example: 10
SortString
The column name you want to sort. Please refer to the available keys of object from the template (such as Name, TemplateAuthor, etc.)
Example: Name
SortAscBoolean
The option to order your retrieved contents (ascending or descending). The default is to return the contents in ascending order.
SearchObject
Search media based on their types and/or publishing status.
Example: "Search: { Type: ["image"], Status: ["Changed"] }"

 

Responses
SuccessFailed

{
    
"mediaLists": {
        "status"
: 200,
        "totalItems": 2,
        "error": 
null,
        "data": [
            {
                "Name"
"media2",
                "PublishedAt"
"",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T09:29:33.757Z",
                "MediaID"
"Media_ca718a98-9499-4d2a-823d-896f54a4833c",
                "Data"
: {
                    "Size"
"594",
                    "Extension"
"png",
                    "ParentName"
"Media Asset",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/ca718a98-9499-4d2a-823d-896f54a4833c.png......",
                    "Type"
"image"
                },
                "Acl"
: {
                    "Administer"
"Allow",
                    "Create"
"Allow",
                    "Delete"
"Allow",
                    "Edit"
"Allow",
                    "Read"
"Allow"
                },
                "Status"
"Unpublished"
            },
            {
                "Name": 
"media1",
                "PublishedAt"
"2023-02-21T07:44:28.189Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-21T07:44:28.189Z",
                "MediaID"
"Media_352c2eb6-5145-4287-a0be-0964b34c7a91",
                "Data"
: {
                    "Size"
"594",
                    "Extension"
"png",
                    "ParentName"
"Media Asset",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/media1_published.png......",
                    "Type"
"image"
                },
                "Acl": {
                    "Administer"
"Allow",
                    "Create"
"Allow",
                    "Delete"
"Allow",
                    "Edit"
"Allow",
                    "Read"
"Allow"
                },
                "Status"
"Published"
            }
        ]
    }
}

{
    "status": 500,
    "message": "Oops! Something went wrong...
"
}

 

GET Media

Retrieve a single object data of media.

https://api.nimvio.com/cma/rest/v1/media

Put the queries in Query Parameters.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf246"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77fd241"
ItemIDString
The ID of your Media without prefix Template_.
Example: "5b45888a-dbf8-46d7-ba6a-bfedb82e1869"

 

Responses
SuccessFailed
{
    
"media": {
        "status"
: 200,
        "error": 
null,
        "message": null,
        "data": [
            {
                "Name"
"media5",
                "MediaID"
"Media_5b45888a-dbf8-46d7-ba6a-bfedb82e0869",
                "MediaIDView"
"Media_5b45888a-dbf8-46d7-ba6a-bfedb82e0869",
                "ParentID"
"Media Asset",
                "Status"
"Unpublished",
                "Data"
: {
                    "Type"
"image",
                    "Folder"
"Media Asset",
                    "Extension"
"png",
                    "Size"
"594",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/5b45888a-dbf8-46d7-ba6a-bfedb82e0869.png.....",
                    "AlternateText"
"",
                    "S3URLView"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/media5_published.png"
                },
                "EditableFields"
: {},
                "Ancestors"
: [
                    {
                        "SortKey"
"Media Asset",
                        "Name"
"Media Asset"
                    }
                ],
                "PublishedAt"
"",
                "CreatedAt"
"2023-03-21T09:08:50.421Z",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "LastUpdate"
"2023-03-21T09:08:50.421Z",
                "UpdatedBy"
"Hilman Fauzi Rijal"
            }
        ]
    }
}

{
    "status"
: 404,
    "message"
"Failed to {{ActionName}} {{EntityName}} due to not found on the database."
}

 

POST Generate S3 URL

Generate the media URL.

https://api.nimvio.com/cma/rest/v1/generateUrl

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74df146"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77gd341"
ItemIDString
The ID of your Media without prefix Media_.
Example: "04811b6a-b299-4b4c-84b0-b2c298da9f66"
MediaObject
An object of media consists of file name, file extension, and file size in bytes.
Example:
"Media": {
    "FileName": "media3",
    "Extension": "png",
    "Size": 594
}

 

Responses
SuccessFailed
{
    
"generateUrl": {
        "status"
: 200,
        "error"
null,
        "data"
: [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "MediaID"
"Media_04811b6a-b299-4b4c-84b0-b2c298da8f66",
                "Data"
: {
                    "S3URL"
"https://nimvio-s3-storage143432-develop.s3.amazonaws.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/04811b6a-b299-4b4c-84b0-b2c298da8f66.png......"
                }
            }
        ]
    }
}
{
   
"status": 422,
   "message": "The Media name media3 is already exist in this folder. Please try again with another name.
"
}

 

POST Upload Media

Uploading the new media.

https://api.nimvio.com/cma/rest/v1/uploadMedia

Put the queries in the body request as JSON.

QueriesDescription
TenantIDString MANDATORY
The ID of your Tenant.
Example: "Tenant_371c7a75-7048-47fb-8221-f887c74cf246"
EnvironmentIDString MANDATORY
The Project Environment ID. You can get this ID in Project > General Setting and remove the prefix Project_.
Example: "71e6b953-9076-476f-b46c-7d8ec77gd341"
ParentIDString
The ID of the folder that this new media will store in.
Example: "Media_1dc957b4-e198-4692-afcb-97bf4099c670"
ParentNameString
The name of the folder that this new media will store in.
Example: "Images Folder"
FileNameString
Name of the new media.
Example: "media3"
ExtensionString
Extension type of the new media.
Example: "png"
SizeNumber
Size of the new media in bytes.
Example: "594"

 

Responses
SuccessFailed
{
    
"uploadMedia": {
        "status"
: 200,
        "error"
null,
        "data"
: [
            {
                "Name"
"media3",
                "Data": {
                    "S3URL"
"https://nimvio-s3-storage143432-develop.s3.amazonaws.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/04811b6a-b299-4b4c-84b0-b2c298da8f66.png......"
                }
            }
        ]
    }
}
{
   
"status": 422,
   "message": "The Media name media3 is already exist in this folder. Please try again with another name.
"
}

 

GraphQL

The base URL for using Management API via GraphQL is https://api.nimvio.com/cma/graphql/v1.

Content

POST Content List

Retrieve a dynamically paginated list of templates.

QueryVariables

query contents(
  $ProjectID: String!
  $TenantID: String!
  $ContentIDs: [String]
  $ExcludedContents: [String]
  $Page: Int
  $PageSize: Int
  $QuickSearch: String
  $Sort: String
  $SortAsc: Boolean
  $TemplateName: [String]
  $ContentStatus: [String]
  $ContentAuthor: [String]
) {
  contents(
    ProjectID: $ProjectID
    TenantID: $TenantID
    ContentIDs: $ContentIDs
    
ExcludedContents: $ExcludedContents
    QuickSearch: $QuickSearch
    Page: $Page
    PageSize: $PageSize
    Sort: $Sort
    SortAsc: $SortAsc
    TemplateName: $TemplateName
    ContentAuthor: $ContentAuthor
    ContentStatus: $ContentStatus

  ) {
    status
    totalItems
    lastEvaluatedKey
    message
    error {
      ErrorType
      Message
    }
    data {
      ... on Content {
        ContentID: SortKey
        ParentID
        Name
        TemplateName
        Status
        CreatedBy
        PublishedAt
        UpdatedAt
        Data
        HasChild
        Acl {
          Edit
          Delete
          Administer
        }
      }
    }
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27111d57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf506",
    "Sort": 
"",
    "Page": 1,
    "PageSize"
: 20,
    "SortAsc"
false,
    "QuickSearch"
"",
    "ContentStatus": [],
    "TemplateName"
: [],
    "ContentAuthor"
: []
}

 

Responses
SuccessFailed
{
    "contents"
: {
        "status": 200,
        "totalItems": 2,
        "lastEvaluatedKey"
null,
        "error": null,
        "data": [
            {
                "Name"
"TestCMCreateContent1",
                "TemplateName"
"RTE Test",
                "Status"
"Unpublished",
                "Data"
null,
                "CreatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T08:44:54.750Z",
                "PublishedAt"
"2023-02-22T07:50:16.787Z",
                "ParentID"
"Content",
                "ContentID"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "HasChild"
null,
                "Acl"
: {
                    "Edit"
"Allow",
                    "Delete"
"Allow",
                    "Administer"
"Allow"
                }
            },
            {
                "Name"
"TestCMCreateContent",
                "TemplateName"
"RTE Test",
                "Status"
"Unpublished",
                "Data"
null,
                "CreatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T06:41:36.717Z",
                "PublishedAt"
null,
                "ParentID"
"Content",
                "ContentID"
"Content_b19e60c6-78c1-4151-a3b8-8ac90b285802",
                "HasChild"
null,
                "Acl"
: {
                    "Edit"
"Allow",
                    "Delete"
"Allow",
                    "Administer"
"Allow"
                }
            }
        ]

    }
}

{
    "data": {
        "contents": null
    },
    "errors": [
        {
            "path": [
                "contents"
            ],
            "data": null,
            "errorType": "Internal Server Error"
,
            "errorInfo": {
                "errorCode": 500,

                "component""alert"
            },
            "locations"
: [
                {
                    "line"
: 15,
                    "column"
: 3,
                    "sourceName"
: null
                }
            ],
            "message": "Oops! Something went wrong..."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Content

Retrieve a single object data of content.

QueryVariables

query content(
  $ProjectID: String!
  $TenantID: String!
  $ContentID: String!
) {
  content(
    ProjectID: $ProjectID
    TenantID: $TenantID
    ContentID: $ContentID
  ) {
    status
    totalItems
    message
    error {
      ErrorType
      Message
    }
    data {
      ... on Content {
        ContentID: SortKey
        ContentIDView
        Name
        TemplateName
        TemplateID
        Status
        CreatedBy
        CreatedAt
        UpdatedBy
        PublishedAt
        UpdatedAt
        Data
        HasChild
        Template {
          Components
        }
        Ancestors {
          SortKey
          Name
        }
        UnpublishedLinkedItems {
          Name
          ItemType
        }

      }
    }
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27111d57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cfa46",
    "ContentID"
"Content_d64d1387-3799-4485-ac19-b856bc18cd2c"
}

 

Responses
Success

{
    "content"
: {
        "status"
: 200,
        "error"null,
        "data": [
            {
                "ContentID": 
"Content_d64d1387-3799-4485-ac19-b856bc18cd2c",
                "ContentIDView"
"Content_d64d1387-3799-4485-ac19-b856bc18cd2c",
                "Name"
"Test2",
                "TemplateName"
"RTE Test",
                "TemplateID": 
"Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "Status"
"Published",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "CreatedAt"
"2023-02-22T02:38:15.283Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "PublishedAt"
"2023-02-22T02:38:48.229Z",
                "UpdatedAt"
"2023-02-22T02:38:48.229Z",
                "Data"
"{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}",
                "HasChild"
true,
                "Template"
: {
                    "Components"
"{\n  \"components\": [\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 0,\n      \"isSaved\": true,\n      \"tableView\": true,\n      \"label\": \"RTE Test\",\n      \"ID\": \"rteTest\",\n      \"type\": \"customRTE\",\n      \"key\": \"rteTest\"\n    },\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 1,\n      \"data\": {\n        \"categoryAssets\": [\n          \"Image\",\n          \"Document\",\n          \"Audio\",\n          \"Video\",\n          \"Folder\"\n        ],\n        \"category\": \"\",\n        \"canceledUpload\": [],\n        \"uploadedAssets\": [],\n        \"dropFiles\": []\n      },\n      \"isSaved\": true,\n      \"tableView\": false,\n      \"mediaPermissions\": {\n        \"create\": true,\n        \"read\": true\n      },\n      \"label\": \"Media\",\n      \"ID\": \"media\",\n      \"storage\": \"url\",\n      \"type\": \"assets\",\n      \"key\": \"media\",\n      \"url\": \"https://angular-file-upload-cors-srv.appspot.com/upload\"\n    }\n  ]\n}"
                },
                "Ancestors"
: [],
                "UnpublishedLinkedItems"
null
            },
        ]

    }
}

Failed

{
    "data": {
        "content": null
    },
    "errors": [
        {
            "path": [
                "content"
            ],
            "data": null,
            "errorType": "Internal Server Error"
,
            "errorInfo": {
                "errorCode": 500,

                "component""alert"
            },
            "locations"
: [
                {
                    "line"
: 3,
                    "column"
: 3,
                    "sourceName"
: null
                }
            ],
            "message": "Oops! Something went wrong..."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Create Content

Create new content.

QueryVariables

mutation createContent(
  $ProjectID: String!
  $TenantID: String!
  $TemplateID: String!
  $ContentName: String
  $ParentID: String
) {
  createContent(
    ProjectID: $ProjectID
    TenantID: $TenantID
    TemplateID: $TemplateID
    ContentName: $ContentName
    ParentID: $ParentID
  ) {
    status
    totalItems
    message
    error {
      ErrorType
      Message
    }
    data {
      ... on Content {
        ContentID: SortKey
        Name
        TemplateID
        ProjectID
        ParentID
        Status
        }

      }
    }
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27113a57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf526",
    "TemplateID": 
"Template_70ebe2ab-2aee-4107-92f2-33b3adec9d87",
    "ContentName"
"TestCMCreateContent-2",
    "ParentID"
"Content"
}

 

Responses
SuccessFailed
{
    "createContent": {
        "status": 200,
        "totalItems": 1,
        "error": null,
        "data": [
            {
                "Name": "TestCMCreateContent-2",
                "Status": "Unpublished",
                "TemplateID": "Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "ContentID": "Content_e39a4822-64a9-46c8-8077-bd6a4452c7aa",
                "ParentID": "Content"
            }
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully created.",
        "lastEvaluatedKey": null
    }
}

{
    "data": {
        "createContent": null
    },
    "errors": [
        {
            "path": [
                "createContent"
            ],
            "data": null,
            "errorType": "Unprocessable Entity",
            "errorInfo": {
                "errorCode": 422,
                "additional": "Content Name Already Exist.",
                "component": "alert",
                "invocationType": "Synchronous"
            },
            "locations": [
                {
                    "line": 9,
                    "column": 7,
                    "sourceName": null
                }
            ],
            "message": "The Content name TestCMCreateContent is already exists. Please try again with another name."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Update Content

Edit or update existing content.

QueryVariables

mutation updateContent(
  $ProjectID: String!
  $TenantID: String!
  $ContentID: String!
  $Name: String
  $Status: String
  $Data: String
  $PublishLinkedContents: Boolean
  $PublishSubContents: Boolean
) {
  updateContent(
    ProjectID: $ProjectID
    TenantID: $TenantID
    ContentID: $ContentID
    Name: $Name
    Status: $Status
    Data: $Data
    PublishFlag: {
      LinkedContent: $PublishLinkedContents
      SubContent: $PublishSubContents
    }
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Content {
        ContentID: SortKey
        ContentIDView
        Name
        TemplateName
        TemplateID
        Status
        CreatedBy
        CreatedAt
        UpdatedBy
        PublishedAt
        UpdatedAt
        Data
        HasChild
        Template {
          Components
        }
        Ancestors {
          SortKey
          Name
        }
        UnpublishedLinkedItems {
          Name
          ItemType
        }

      }
    }
    message
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27113f57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf146",
    "Data": 
"{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}",
    "Status"
"Unpublished",
    "ContentID"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88523688"
}

 

Responses
Success

{
    "updateContent"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "ContentID"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "ContentIDView"
"Content_bd1b146c-e3ef-43ee-8a9d-cadc88573688",
                "Name"
"TestCMCreateContent1",
                "TemplateName"
"RTE Test",
                "TemplateID"
"Template_70ebe2ab-2aee-4107-92f2-33b3adeb9d87",
                "Status"
"Unpublished",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "CreatedAt"
"2023-02-22T06:51:07.582Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "PublishedAt"
"2023-02-22T07:50:16.787Z",
                "UpdatedAt"
"2023-03-21T08:59:29.115Z",
                "Data"
"{\"rteTest\":\"\",\"media\":{\"Type\":\"Reference\",\"ReferenceType\":\"Media\"}}",
                "HasChild"
false,
                "Template"
: {
                    "Components"
"{\n  \"components\": [\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 0,\n      \"isSaved\": true,\n      \"tableView\": true,\n      \"label\": \"RTE Test\",\n      \"ID\": \"rteTest\",\n      \"type\": \"customRTE\",\n      \"key\": \"rteTest\"\n    },\n    {\n      \"input\": true,\n      \"templateFieldNumber\": 1,\n      \"data\": {\n        \"categoryAssets\": [\n          \"Image\",\n          \"Document\",\n          \"Audio\",\n          \"Video\",\n          \"Folder\"\n        ],\n        \"category\": \"\",\n        \"canceledUpload\": [],\n        \"uploadedAssets\": [],\n        \"dropFiles\": []\n      },\n      \"isSaved\": true,\n      \"tableView\": false,\n      \"mediaPermissions\": {\n        \"create\": true,\n        \"read\": true\n      },\n      \"label\": \"Media\",\n      \"ID\": \"media\",\n      \"storage\": \"url\",\n      \"type\": \"assets\",\n      \"key\": \"media\",\n      \"url\": \"https://angular-file-upload-cors-srv.appspot.com/upload\"\n    }\n  ]\n}"
                },
                "Ancestors"
: [],
                "UnpublishedLinkedItems"
null
            }
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully updated.",
        "lastEvaluatedKey"
null
    }
}

Failed{
    "data"
: {
        "updateContent"
null
    },
    "errors"
: [
        {
            "path"
: [
                "updateContent"
            ],
            "data"
null,
            "errorType"
"Not Found",
            "errorInfo": {
                "errorCode": 404,
                "additional"
"Template with PK: Project_d1e92fec-55b8-49b5-8440-a2fc27113d57 and SK: Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c is not found on NimvioTableV2-develop table.",
                "component"
"alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 3,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
: "Failed to read template due to template is not found on the database."
        }
    ],
    "status": 200,
    "headers"
: {}
}

 

POST Delete Content

Delete an existing content.

QueryVariables

mutation deleteContent(
  $ProjectID: String!
  $TenantID: String!
  $ContentID: String!
) {
  deleteContent(
    ProjectID: $ProjectID
    TenantID: $TenantID
    ContentID: $ContentID
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Content {
        Name
        Status
        SearchName
        ParentID
        CreatedAt
        UpdatedAt
        ContentID: SortKey
      }
    }
    message
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27111d57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf526",
    "ContentID"
"Content_e39a4822-64a9-46c8-8077-bd6a4452c7aa"
}

 

Responses
SuccessFailed

{
    "deleteContent"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "Name"
"TestCMCreateContent-2",
                "Status"
"Unpublished",
                "SearchName"
null,
                "ParentID"
"Content",
                "CreatedAt"
"2023-03-21T08:57:45.201Z",
                "UpdatedAt"
"2023-03-21T08:57:45.201Z",
                "ContentID"
"Content_e39a4822-64a9-46c8-8077-bd6a4452c7aa"
            },
        ],
        "message": "Content <b>TestCMCreateContent-2</b> has been successfully deleted.",
        "lastEvaluatedKey"
null
    }
}

{
    "data": {
        "deleteContent": null
    },
    "errors": [
        {
            "path": [
                "deleteContent"
            ],
            "data": null,
            "errorType": "Lambda:Unhandled",
            "errorInfo": null
,
            "locations"
: [
                {
                    "line"
: 12,
                    "column"
: 3,
                    "sourceName": null
                }
            ],
            "message": "
TypeError: Cannot convert undefined or null to object"
        }
    ],
    "status": 200,
    "headers": {}
}

 

Template

POST Template List

Retrieve a dynamically paginated list of templates.

QueryVariables

query Templates(
  $ProjectID: String!
  $TenantID: String!
  $TemplateName: String
  $TemplateAuthor: String
  $Page: Int
  $PageSize: Int
  $QuickSearch: String
  $Sort: String
  $SortAsc: Boolean
) {
  templates(
    ProjectID: $ProjectID
    TenantID: $TenantID
    TemplateName: $TemplateName
    TemplateAuthor: $TemplateAuthor
    Page: $Page
    PageSize: $PageSize
    QuickSearch: $QuickSearch
    Sort: $Sort
    SortAsc: $SortAsc
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Template {
        ProjectID
        TemplateID: SortKey
        Name
        AuthorUsername
        TotalContent
        UpdatedAt
        WorkflowName
      }
    }
    message
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27112d57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf536",
    "TemplateName": 
"",
    "TemplateAuthor"
"",
    "Page"
: 1,
    "PageSize"
: 20,
    "QuickSearch"
"",
    "SortAsc"
false
}

 

Responses
SuccessFailed

{
    "templates"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data": [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c",
                "Name"
"TempateTest1",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "TotalContent"
: 0,
                "UpdatedAt"
"2023-03-21T09:16:35.503Z",
                "WorkflowName"
""
            },
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_e1875a1f-7635-4a6a-9718-99c914fc35e0",
                "Name"
"TempateTest",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "TotalContent"
: 0,
                "UpdatedAt"
"2023-03-16T04:25:54.883Z",
                "WorkflowName"
""
            },
        ]

    }
}

{
    "data": {
        "templates": null
    },
    "errors": [
        {
            "path": [
                "templates"
            ],
            "data": null,
            "errorType": "Internal Server Error"
,
            "errorInfo": {
                "errorCode": 500,

                "component""alert"
            },
            "locations"
: [
                {
                    "line"
: 12,
                    "column"
: 3,
                    "sourceName"
: null
                }
            ],
            "message": "Oops! Something went wrong..."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Template

Retrieve a single object data of template.

QueryVariables

mutation deleteTemplate(
  $ProjectID: String!
  $TemplateID: String!
  $TenantID: String!
) {
  deleteTemplate(
    ProjectID: $ProjectID
    TemplateID: $TemplateID
    TenantID: $TenantID
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Template {
        ProjectID
        TemplateID: SortKey
        Name
        AuthorUsername
        UpdatedAt
      }
    }
    message
    lastEvaluatedKey
  }
}

{
    "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d59",
    "TemplateID": 
"Template_44eb4cbe-138c-467d-8d6e-05aef31bb98c",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cfb46"
}

 

Responses
Success

{
    "template"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {
                "Name"
"TemplateTest1",
                "Components"
"{\n    \"components\": [\n        {\n            \"input\": true,\n            \"templateFieldNumber\": 0,\n            \"isSaved\": true,\n            \"tableView\": true,\n            \"label\": \"Test\",\n            \"ID\": \"test\",\n            \"type\": \"textfield\",\n            \"showCharCount\": true,\n            \"isSlug\": false,\n            \"key\": \"test\"\n        }\n    ]\n}",
                "TenantID"
"Tenant_81ac23c3-9b27-4ed3-bc35-42c6ddbe9db1",
                "WorkflowID"
null
            }
        ]
    }
}

Failed

{
    "data"
: {
        "template"
null
    },
    "errors"
: [
        {
            "path"
: [
                "template"
            ],
            "data"
null,
            "errorType"
"Not Found",
            "errorInfo": {
                "errorCode": 404,
                "additional"
"Template with PK: Project_d1e92fec-55b8-49b5-8440-a2fc27113d57 and SK: Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c is not found on NimvioTableV2-develop table.",
                "component"
"alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 3,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
: "Failed to read template due to template is not found on the database."
        }
    ],
    "status": 200,
    "headers"
: {}
}

 

POST Create Template

Create a new template.

QueryVariables

mutation CreateTemplate(
  $ProjectID: String!
  $TenantID: String!
  $TemplateName: String
  $TemplateComponents: String
  $WorkflowID: String!
) {
  updateTemplate(
    ProjectID: $ProjectID
    TenantID: $TenantID
    TemplateName: $TemplateName
    TemplateComponents: $TemplateComponents
    WorkflowID: $WorkflowID
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Template {
        Name
      }
    }
    message
  }
}

{
    "ProjectID"
: "Project_d1e92fec-55b8-49b5-8440-a2fc27113v57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cfd46",
    "TemplateName": 
"TempateTest1",
    "TemplateComponents"
"{\"components\":[{\"label\":\"Test1\",\"key\":\"test\",\"ID\":\"test\",\"isSlug\":false,\"type\":\"textfield\",\"input\":true,\"templateFieldNumber\":0,\"isSaved\":true,\"tableView\":true,\"showCharCount\":true}]}",
    "WorkflowID"""
}

 

Responses
SuccessFailed

{
    "createTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {

                "Name""TempateTest1"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully created."
    }
}

{
    "data": {
        "createTemplate": 
null
    },
    "errors": [
        {
            "path": [
                "createTemplate"
            ],
            "data": null
,
            "errorType"
"Unprocessable Entity",
            "errorInfo": {
                "errorCode": 422,

                "component""alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 10,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message": "Failed to create template due to the name already exists in the table. Please try again with the valid input."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Update Template

Edit or update an existing template.

QueryVariables

mutation UpdateTemplate(
  $ProjectID: String!
  $TenantID: String!
  $TemplateID: String!
  $TemplateName: String
  $TemplateComponents: String
  $WorkflowID: String!
  $RetainValue: Boolean
) {
  updateTemplate(
    ProjectID: $ProjectID
    TenantID: $TenantID
    TemplateID: $TemplateID
    TemplateName: $TemplateName
    TemplateComponents: $TemplateComponents
    WorkflowID: $WorkflowID
    RetainValue: $RetainValue
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Template {
        Name
      }
    }
    message
  }
}

{
    "ProjectID"
: "Project_d1e92fec-55b8-49b5-8440-a2fc27113s57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf536",
    "TemplateID": "Template_44eb4cbe-138c-467d-8d6e-05aef31ba68c",
    "TemplateName": 
"TempateTest1",
    "TemplateComponents"
"{\"components\":[{\"label\":\"Test1\",\"key\":\"test\",\"ID\":\"test\",\"isSlug\":false,\"type\":\"textfield\",\"input\":true,\"templateFieldNumber\":0,\"isSaved\":true,\"tableView\":true,\"showCharCount\":true}]}",
    "RetainValue"
false,
    "WorkflowID"
""
}

 

Responses
Success 
{
    "updateTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {

                "Name""TempateTest1"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully updated."
    }
}

{
    "data"
: {
        "updateTemplate"
null
    },
    "errors"
: [
        {
            "path": [
                "updateTemplate"
            ],
            "data": 
null,
            "errorType"
"Unprocessable Entity",
            "errorInfo": {
                "errorCode": 422,

                "component""alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 10,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message": "Failed to update template due to the name already exists in the table. Please try again with the valid input."
        }
    ],
    "status": 200,
    "headers": {}
}

 

POST Delete Template

Delete an existing template.

QueryVariables

mutation deleteTemplate(
  $ProjectID: String!
  $TemplateID: String!
  $TenantID: String!
) {
  deleteTemplate(
    ProjectID: $ProjectID
    TemplateID: $TemplateID
    TenantID: $TenantID
  ) {
    status
    totalItems
    error {
      ErrorType
      Message
    }
    data {
      ... on Template {
        ProjectID
        TemplateID: SortKey
        Name
        AuthorUsername
        UpdatedAt
      }
    }
    message
    lastEvaluatedKey
  }
}

{
    "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113b57",
    "TemplateID": 
"Template_44eb4cbe-138c-467d-8d6e-05aef31db68c",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf246"
}

 

Responses
SuccessFailed

{
    "deleteTemplate"
: {
        "status"
: 200,
        "totalItems"
: 1,
        "error"
null,
        "data"
: [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "TemplateID"
"Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c",
                "Name"
"TempateTest1",
                "AuthorUsername"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-03-21T09:16:35.503Z"
            }
        ],
        "message"
"Template <b>TempateTest1</b> has been successfully deleted.",
        "lastEvaluatedKey"
null
    }
}

{
    "data"
: {
        "deleteTemplate"
null
    },
    "errors"
: [
        {
            "path"
: [
                "deleteTemplate"
            ],
            "data"
null,
            "errorType"
"Internal server error",
            "errorInfo": {
                "errorCode": 404,
                "additional"
"Template with PK: Project_d1e92fec-55b8-49b5-8440-a2fc27113d57 and SK: Template_44eb4cbe-138c-467d-8d6e-05aef31bb68c is not found on NimvioTableV2-develop table.",
                "component"
"alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 3,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
: "Failed to delete template due to template is not found on the database."
        }
    ],
    "status": 200,
    "headers"
: {}
}

 

Media

POST Media List

Retrieve a dynamically paginated list of media.

QueryVariables

query MediaList(
  $ProjectID: String!
  $TenantID: String!
  $Page: Int
  $PageSize: Int
  $Search: MediaSearch
  $Sort: String
  $SortAsc: Boolean
) {
  media(
    ProjectID: $ProjectID
    TenantID: $TenantID
    Search: $Search
    Page: $Page
    PageSize: $PageSize
    Sort: $Sort
    SortAsc: $SortAsc
  ) {
    data {
      ... on Media {
        Name
        PublishedAt
        UpdatedBy
        UpdatedAt
        MediaID
        Status
        Data {
          Type
          ParentName
          Extension
          Size
          S3URL
        }
       Acl {
          Administer
          Create
          Delete
          Edit
          Read
        }
      }
    }
    message
    status
    error {
      ErrorType
      Message
    }
  }
}

{
    "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113a57",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf446",
    "Page": 1,
    "PageSize"
: 20,
    "Sort"
"",
    "SortAsc"
false,
    "Search"
: {}
}

 

Responses
SuccessFailed
{
    
"mediaLists": {
        "status"
: 200,
        "totalItems": 2,
        "error": 
null,
        "data": [
            {
                "Name"
"media2",
                "PublishedAt"
"",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-22T09:29:33.757Z",
                "MediaID"
"Media_ca718a98-9499-4d2a-823d-896f54a4833c",
                "Data"
: {
                    "Size"
"594",
                    "Extension"
"png",
                    "ParentName"
"Media Asset",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/ca718a98-9499-4d2a-823d-896f54a4833c.png......",
                    "Type"
"image"
                },
                "Acl"
: {
                    "Administer"
"Allow",
                    "Create"
"Allow",
                    "Delete"
"Allow",
                    "Edit"
"Allow",
                    "Read"
"Allow"
                },
                "Status"
"Unpublished"
            },
            {
                "Name": 
"media1",
                "PublishedAt"
"2023-02-21T07:44:28.189Z",
                "UpdatedBy"
"Hilman Fauzi Rijal",
                "UpdatedAt"
"2023-02-21T07:44:28.189Z",
                "MediaID"
"Media_352c2eb6-5145-4287-a0be-0964b34c7a91",
                "Data"
: {
                    "Size"
"594",
                    "Extension"
"png",
                    "ParentName"
"Media Asset",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/media1_published.png......",
                    "Type"
"image"
                },
                "Acl": {
                    "Administer"
"Allow",
                    "Create"
"Allow",
                    "Delete"
"Allow",
                    "Edit"
"Allow",
                    "Read"
"Allow"
                },
                "Status"
"Published"
            }
        ]
    }
}

{
    "data"
: {
        "mediaList"
null
    },
    "errors"
: [
        {
            "path"
: [
                "mediaList"
            ],
            "data"
null,
            "errorType"
"Internal server error",
            "errorInfo"
: {
                "errorCode"
: 500,
                "component""alert"
            },
            "locations"
: [
                {
                    "line"
: 10,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
"Oops! Something went wrong."
        }
    ],
    "status"
: 200,
    "headers"
: {}
}

 

POST Media

Retrieve a single object data of media.

QueryVariables

query Media(
  $ProjectID: String!
  $MediaID: String!
  $TenantID: String!
  $IsPicOrVid: Boolean = 
false
  $IsAudio: Boolean = 
false
  $IsDoc: Boolean = 
false
) {
  media(
    MediaID: $MediaID
    ProjectID: $ProjectID
    TenantID: $TenantID
  ) {
    data {
      ... on Media {
        Name
        MediaID
        MediaIDView
        ParentID
        Status
        Data {
          Type
          Folder: ParentName
          Extension
          Size
          S3URL
          AlternateText
          S3URLView
        }
        EditableFields: Data {
          ... @include(
if: $IsPicOrVid) {
            Title
            FileName
            Size
            Copyright
          }
          ... @include(
if: $IsAudio) {
            Title
            FileName
            Size
            Copyright
          }
          ... @include(
if: $IsDoc) {
            Title
            FileName
            Size
            Author
          }
        }
        Ancestors {
          SortKey
          Name
        }
        PublishedAt
        CreatedAt
        CreatedBy
        LastUpdate: UpdatedAt
        UpdatedBy
      }
    }
    message
    status
    error {
      Additional
      ErrorType
      Message
    }
  }
}

{
    "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d37",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf336",
    "Page": 1,
    "PageSize"
: 20,
    "Sort"
"",
    "SortAsc"
false,
    "Search"
: {}
}

 

Responses
SuccessFailed
{
    
"media": {
        "status"
: 200,
        "error": 
null,
        "message": null,
        "data": [
            {
                "Name"
"media5",
                "MediaID"
"Media_5b45888a-dbf8-46d7-ba6a-bfedb82e0869",
                "MediaIDView"
"Media_5b45888a-dbf8-46d7-ba6a-bfedb82e0869",
                "ParentID"
"Media Asset",
                "Status"
"Unpublished",
                "Data"
: {
                    "Type"
"image",
                    "Folder"
"Media Asset",
                    "Extension"
"png",
                    "Size"
"594",
                    "S3URL"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/5b45888a-dbf8-46d7-ba6a-bfedb82e0869.png.....",
                    "AlternateText"
"",
                    "S3URLView"
"https://media-dev.nimvio.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/media5_published.png"
                },
                "EditableFields"
: {},
                "Ancestors"
: [
                    {
                        "SortKey"
"Media Asset",
                        "Name"
"Media Asset"
                    }
                ],
                "PublishedAt"
"",
                "CreatedAt"
"2023-03-21T09:08:50.421Z",
                "CreatedBy"
"Hilman Fauzi Rijal",
                "LastUpdate"
"2023-03-21T09:08:50.421Z",
                "UpdatedBy"
"Hilman Fauzi Rijal"
            }
        ]
    }
}

{
    "data"
: {
        "media"
null
    },
    "errors"
: [
        {
            "path"
: [
                "media"
            ],
            "data"
null,
            "errorType"
"Not found",
            "errorInfo"
: {
                "errorCode"
: 400,
                "additional"
"Failed to {{ActionName}} {{EntityName}} due to not found on the database.",
                "component"
"alert",
                
"invocationType""Synchronous"
            },
            "locations": [
                {
                    "line": 9,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
: "Failed to {{ActionName}} {{EntityName}} due to not found on the database."
        }
    ],
    "status": 200,
    "headers"
: {}
}

 

POST Generate S3 URL

Generate the media URL.

QueryVariables

mutation GenerateUrl(
  $EnvironmentID: String!
  $TenantID: String!
  $Media: MediaInput
  $MediaID: String
) {
  generateUrl(
    EnvironmentID: $EnvironmentID
    TenantID: $TenantID
    Media: $Media
    MediaID: $MediaID
   ) {
    status
    error {
      ErrorType
      Message
    }
    data {
      ... on Media {
        ProjectID
        MediaID
        Data {
          S3URL
        }
      }
    }
  }
}

{
    "ProjectID": "Project_d1e92fec-55b8-49b5-8440-a2fc27113211",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf333",
    "Media": {
        "FileName": "media4",
        "Extension": "png",
        "Size": 594
    }
}

 

Responses
SuccessFailed
{
    
"generateUrl": {
        "status"
: 200,
        "error"
null,
        "data"
: [
            {
                "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc27113d57",
                "MediaID"
"Media_04811b6a-b299-4b4c-84b0-b2c298da8f66",
                "Data"
: {
                    "S3URL"
"https://nimvio-s3-storage143432-develop.s3.amazonaws.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/04811b6a-b299-4b4c-84b0-b2c298da8f66.png......"
                }
            }
        ]
    }
}

{
    "data"
: {
        "generateUrl"
null
    },
    "errors"
: [
        {
            "path"
: [
                "generateUrl"
            ],
            "data"
null,
            "errorType"
"Unprocessable Entity",
            "errorInfo"
: {
                "errorCode"
: 422,
                "additional"
"Media Name Already Exist.",
                "component"
"alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 7,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
"The Media name media3 is already exist in this folder. Please try again with another name."
        }
    ],
    "status"
: 200,
    "headers"
: {}
}

 

POST Upload Media

Uploading the new media.

First, use S3URL from the generateUrl response to upload the media and request to uploadMedia endpoint.

QueryVariables

mutation UploadMedia(
  $ProjectID: String!
  $MediaID: String!
  $TenantID: String!
  $FileName: String
  $Extension: String
  $ParentID: String
  $ParentName: String
  $Size: Float
) {
  uploadMedia(
    Media: {
      FileName: $FileName
      Extension: $Extension
      ParentID: $ParentID
      ParentName: $ParentName
      Size: $Size
    }
    ProjectID: $ProjectID
    MediaID: $MediaID
    TenantID: $TenantID
  ) {
    data {
      ... on Media {
        Name
        Data {
          S3URL
        }
      }
    }
    status
    error {
      ErrorType
      Message
    }
  }
}

{
    "ProjectID"
"Project_d1e92fec-55b8-49b5-8440-a2fc2711333",
    "TenantID": "Tenant_371c7a75-7048-47fb-8221-f887c74cf333",
    "FileName": 
"media5",
    "Extension"
"png",
    "ParentID"
"Media Asset",
    "ParentName"
"Media Asset",
    "Size"
: 594,
    "MediaID"
"Media_5b45888a-dbf8-46d7-ba6a-bfedb82e0833"
}

 

Responses
SuccessFailed
{
    
"uploadMedia": {
        "status"
: 200,
        "error"
null,
        "data"
: [
            {
                "Name"
"media5",
                "Data": {
                    "S3URL"
"https://nimvio-s3-storage143432-develop.s3.amazonaws.com/Project_d1e92fec-55b8-49b5-8440-a2fc27113d57/Media/04811b6a-b299-4b4c-84b0-b2c298da8f66.png......"
                }
            }
        ]
    }
}

{
    "data"
: {
        "uploadMedia"
null
    },
    "errors"
: [
        {
            "path"
: [
                "uploadMedia"
            ],
            "data"
null,
            "errorType"
"Unprocessable Entity",
            "errorInfo"
: {
                "errorCode"
: 422,
                "additional"
"Media Name Already Exist.",
                "component"
"alert",
                "invocationType"
"Synchronous"
            },
            "locations"
: [
                {
                    "line"
: 7,
                    "column"
: 3,
                    "sourceName"
null
                }
            ],
            "message"
"The Media name media5 already exists in this folder. Please try again with another name."
        }
    ],
    "status"
: 200,
    "headers"
: {}
}

What is Next?

Congratulations! You have finished the guide. Keep exploring below: