API request javascript

I am trying to make an API request through Javascript via Google Sheets.

 var data = {

  'requestJobDescription':

  {"type": "create",

    "credentials":{

      "partnerUserID":"ID",

      "partnerUserSecret":"SECRET"

    },

    "inputSettings":{

     "type": "policy",

      "policyName": "My New Policy"

    }

  }

  };

  

 payload = JSON.stringify(data);

 var options =  {'method' : 'post',

 'contentType': 'application/json',

 // Convert the JavaScript object to a JSON string.

 'payload' : payload};


When I try to execute this I get the following error:


{"responseMessage":"'requestJobDescription' is missing","responseCode":500}



Please could you assist?


Many thanks

Answers

Sign In or Register to comment.