SZ.chat - Automate Processes with Integration via REST

Modified on Fri, 28 May, 2021 at 12:42 PM



 

Everything you need to know about REST integration in your centralized service tool SZ.chat from Fortics.


Watch the video and any questions you still have with our technical support will be happy to help you.






Use the information below to replicate the integration shown in the video.


Integration APIs documentation


1 - TEST DATA


  • CNPJ without debits - 99.999.999/0001-99


  • CNPJ with debits - 99.999.999/0002-99


  • Token - tokendeexemplo

2 - CRM


  • Method - POST


  • Authentication method - token in header


  • JSON Request
```JSON
{
  "cnpj": "99.999.999/0001-99|OBRIGATORIO"
}

```
  • Successful return
```JSON

{
    "Cidade": "Santa Fé",
    "Estado": "SP",
    "Logradouro": "Av. das americas, 2000",
    "Name": "Empresa de modelo 1",
    "cnpj": "99.999.999/0001-99",
    "pendencias": [],
    "status": "OK"
}

```
  • Unsuccessful return
```JSON

{
    "Cidade": "Santa falta de pagamento",
    "Estado": "SP",
    "Logradouro": "Av. europa, 1000",
    "Name": "Empresa de modelo 2",
    "cnpj": "99.999.999/0002-99",
    "pendencias": [
        {
            "ano": "2020",
            "mes": "Abril",
            "valor": 10000
        },
        {
            "ano": "2020",
            "mes": "Janeiro",
            "valor": 20000
        }
    ],
    "status": "pendente"
}

```


3 - SERVICE DESK



  • Method - POST


  • Authentication method - token in header


  • JSON Request
```JSON

{
    "cnpj": "99.999.999/0001-99|OBRIGATORIO",
    "Problem": "OBRIGATORIO"
}

```


  • Return


```JSON

{
    "date": "14/05/2020",
    "id": 29008,
    "status": "Ticket criado",
    "ticketTitle": "não consigo me logar"
}

```


4 - EXAMPLE SCRIPT


() => {
    let saldo = 0;
    data = JSON.parse(VAR_ENTRADA);
      data.pendencias.forEach(el => {
         saldo = saldo + el.valor;
      });
  
    return saldo;
  };



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article