NAV
javascript

Introduction

Welcome to the generated API reference.

Do you use Postman? Great.
Get Postman Collection
Get Postman Environment

Header

Header Value When should I send?
Accept application/json All requests
Content-Type application/x-www-form-urlencoded Must send when passing query string in request body
Content-Type application/json Must send when passing json in request body
Content-Type multipart/form-data Must send when passing files in request body
Authorization Bearer access_token Whenever the resource requires an authenticated user
Language language All requests

Controlling requests

All API requests are limited to prevent abuse and ensure stability.
The limit is usually 120 requests every 1 minute. But each route can have its own limit.
You can always check the response header to have a status of available requests:

X-RateLimit-Limit → 120
X-RateLimit-Remaining → 25

Errors

API uses the following error codes:

Error Code Meaning
400 Bad Request -- Your request sucks
401 Unauthorized -- Your API key is wrong
403 Forbidden -- You are not authorized or do not have permission to access
404 Not Found -- The specified page can not be found
405 Method Not Allowed -- Method not allowed for this request
406 Not Acceptable -- You have requested a format that is not valid
410 Gone -- The target resource is no longer available
413 Payload Too Large -- Request payload is larger than the server is willing or able to process
422 Unprocessable Entity -- Validation error, the given data was invalid
429 Too Many Requests -- You have sent too many requests in a certain amount of time ("rate limiting")
500 Internal Server Error -- We had a problem with our server. Try again later.
503 Service Unavailable -- We're temporarially offline for maintanance. Please try again later.

Assistencia Tecnica

Get technical assistance

url da api: '/v1/tickets/'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/{id}",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "id": "id",
            "unity_id": "unity_id",
            "ticket_code": "ticket_code",
            "protocol": "protocol",
            "ticket_status_id": "ticket_status_id",
            "ticket_status_name": "ticket_status_name",
            "technical_delivery_id": "#FF8E00",
            "technical_delivery_protocol": "protocol",
            "ambient_id": "ambient_id",
            "ambient_name": "ambient_name",
            "enterprise_name": "enterprise_name",
            "warranty": "warranty",
            "type_ticket": "type_ticket",
            "description_client": "description_client",
            "description_drt": "description_drt",
            "send_date": "send_date",
            "area": "area",
            "ambient": "ambient",
            "images": [
                {
                    "id": "",
                    "name": "",
                    "description": "",
                    "file_url": "",
                    "width": "",
                    "height": "",
                    "thumb_url": "",
                    "thumb_width": "",
                    "thumb_height": "",
                    "date": ""
                }
            ]
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/{id}

Query Parameters

Parameter Type Validation Description
ticket_id integer integer

Create technical assistance

url da api: '/v1/public/tickets'

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://localhost/api/v1/admin/technical-assistance/create",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "id": "id",
            "unity_id": "unity_id",
            "ticket_code": "ticket_code",
            "protocol": "protocol",
            "ticket_status_id": "ticket_status_id",
            "ticket_status_name": "ticket_status_name",
            "technical_delivery_id": "#FF8E00",
            "technical_delivery_protocol": "protocol",
            "ambient_id": "ambient_id",
            "ambient_name": "ambient_name",
            "enterprise_name": "enterprise_name",
            "warranty": "warranty",
            "type_ticket": "type_ticket",
            "description_client": "description_client",
            "description_drt": "description_drt",
            "send_date": "send_date",
            "area": "area",
            "ambient": "ambient",
            "images": [
                {
                    "id": "",
                    "name": "",
                    "description": "",
                    "file_url": "",
                    "width": "",
                    "height": "",
                    "thumb_url": "",
                    "thumb_width": "",
                    "thumb_height": "",
                    "date": ""
                }
            ]
        }
    ]
}

HTTP Request

POST api/v1/admin/technical-assistance/create

Query Parameters

Parameter Type Validation Description
up_id integer integer
ambient_id integer integer
ticket_area_id integer integer
description_client string string

Get technical assistance status list

url da api usadas: '/v1/public/ticketStatus'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/status-list",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "id": 1,
            "name": "valor"
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/status-list

Query Parameters

Parameter Type Validation Description
limit integer integer

Get technical assistance area warranty

url da api usadas: '/v1/ticket-areas'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/area-warranty",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "code": 1654,
            "name": "valor"
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/area-warranty

Query Parameters

Parameter Type Validation Description
up_id integer integer
ticketAreaId integer integer
limit integer integer

Get historic technical assistance

url da api usadas: '/v1/public/comments'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/historic/{ticket_id}",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "data": [
                {
                    "id": "1231",
                    "is_user": "booleano para saber se é cliente ou empresa",
                    "unity_id": "65475",
                    "ticket_id": "12342",
                    "name": "fulano de tal",
                    "avatar": "link imagem",
                    "automatic_answer": "Resposta automática",
                    "is_send_mail_history": 1,
                    "description": "texto da mensagem",
                    "created_at": "2024-05-31T12:18:59-83-08"
                }
            ]
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/historic/{ticket_id}

Query Parameters

Parameter Type Validation Description
ticketId integer integer

Get technical assistance form info

url da api usadas: '/v1/ticket-areas' url da api usadas: '/v1/ambients'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/form-info",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "areas": [
                {
                    "id": "",
                    "name": ""
                }
            ],
            "ambients": [
                {
                    "id": "",
                    "name": "",
                    "type": ""
                }
            ]
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/form-info

Query Parameters

Parameter Type Validation Description
up_id integer integer
limit integer integer
enterprise_up_id integer integer
isCommonArea boolean boolean

Cancel technical assistance

url da api: '/v1/public/tickets/remove-ticket-customer'

Example request:

const axios = require('axios');

axios({
    "method": "post",
    "url": "http://localhost/api/v1/admin/technical-assistance/cancel/{unity}/{id}",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Content-Type": "application/x-www-form-urlencoded",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "itens": [
        {
            "result": true
        }
    ]
}

HTTP Request

POST api/v1/admin/technical-assistance/cancel/{unity}/{id}

Query Parameters

Parameter Type Validation Description
up_id integer integer
ticket_id integer integer

Get all unity technical assistance

url da api: '/v1/public/tickets'

Example request:

const axios = require('axios');

axios({
    "method": "get",
    "url": "http://localhost/api/v1/admin/technical-assistance/all/{unity}",
    "headers": {
        "Authorization": "Bearer {access_token}",
        "Accept": "application/json",
        "Language": "{language}"
    }})
.then(function (response) {
    // handle success
    console.log(response);
})
.catch(function (error) {
    // handle error
    console.log(error);
})
.finally(function () {
    // optional, always executed
});

Example response:

{
    "data": [
        {
            "id": "id",
            "unity_id": "unity_id",
            "ticket_code": "ticket_code",
            "protocol": "protocol",
            "ticket_status_id": "ticket_status_id",
            "ticket_status_name": "ticket_status_name",
            "color_status": "#FF8E00",
            "ambient_id": "ambient_id",
            "ambient_name": "ambient_name",
            "enterprise_name": "enterprise_name",
            "warranty": "warranty",
            "type_ticket": "type_ticket",
            "description_client": "description_client",
            "description_drt": "description_drt",
            "send_date": "send_date"
        }
    ],
    "meta": [
        {
            "current_page": "2",
            "last_page": "1",
            "per_page": "20",
            "total": "100"
        }
    ]
}

HTTP Request

GET api/v1/admin/technical-assistance/all/{unity}

Query Parameters

Parameter Type Validation Description
up_id integer integer
limit integer integer
page integer integer