Node.js API call supported in custom app

Hi, I created a custom app that create a PDF with the assets assigned to the employee.
For creating the PDF, I use the Doppio service, this service support only calls in Node.js and other platform.

Node.js is not supported in browser, I’ve tried to add the API call in the app.js but don’t work.
There is an option for doing this call in Freshservice?

Thank in advance
Manuel

var myHeaders = new Headers();
myHeaders.append("Access-Control-Allow-Origin", "*");
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <!!!>");

var raw = JSON.stringify({
  "templateId": "08417d31-a75c-4eb7-98f7-d433bbc18291",
  "templateData": {
    "DOP_NAME": "Mario Rossi",
    "DOP_ITEMS": [
      {
        "row": 0,
        "id": "33246",
        "name": "M-PA-RD9XLWV9JF"
      },
      {
        "row": 1,
        "id": "63434",
        "name": "Magic Mouse"
      },
      {
        "row": 2,
        "id": "71412",
        "name": "EVOLVE2 30"
      }
    ]
  }
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("https://api.doppio.sh/v1/template/sync", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

Hey @Manuel_Negro,

Welcome to the Freshworks Developer Community! :tada:

I’m not sure about Doppio but if they support via npm package available, you can use the SMI option to generate the PDF.

You can check out more about SMI - Freshworks Developer Docs | Build SMI apps

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.