Expensify API and google script

mb5 Expensify Customer Posts: 3 Expensify Newcomer

I've been trying to create a google script to interact with Expensify API, but I never can make it work and always get the same error :

This is the code : "

function createExpensifyReport() {

var reportName = "Mix_test";

var data = {

"type": "create",

"credentials": {

"partnerUserID": "My_partnerUserID",

"partnerUserSecret": "My_partnerUserSecret"


"inputSettings": {

"type": "report",

"report": {

"reportName": reportName




var options = {

"method": "post",

"headers": {

"Content-Type": "application/json",

"User-Agent": "Mozilla/5.0"


"muteHttpExceptions": true,

"payload": JSON.stringify({

"requestJobDescription": "Create report",

"requestData": JSON.stringify(data)




var response = UrlFetchApp.fetch("[https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations"](https://integrations.expensify.com/Integration-Server/ExpensifyIntegrations), options);




Evertime I run this googlescript code I get an error :


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


⁦I don't see where I go it wrong.

⁦the Logger.log gives me the right Payload :


{"requestJobDescription":"Create report","requestData":"{\"type\":\"create\",\"credentials\":{\"partnerUserID\":\"partnerUserID\",\"partnerUserSecret\":\"partnerUserSecret\"},\"inputSettings\":{\"type\":\"report\",\"report\":{\"reportName\":\"Ann_Mix_test\"}}}"}


Can anyone tell me where is my mistake?