APIs & Integrations

sasikumar
Participant

email api

console.log(emailData, url, 'sddsds')
return new Promise((resolve) => {
let options = {
method: 'POST',
body: {
emailId: 2853049635,
message: {
to: emailData.email,
from: "kalyan.parise@appitventures.com"
},
customProperties: {
value: `Your account has been created, please click on below link to setup your password.<br><br>
<a class="ulink" href="${url}" target="_blank">Set your password</a> <br><br>`
}

},
json: true
};
console.log(options, 'options')
request(options, function (error, response, body) {
if (error) throw new Error(error);

console.log(body);
resolve(body)
});
})
 
i was using this code I was getting error like this 

  status: 'error',

  message: 'Invalid input JSON on line 1, column 120: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token',

  correlationId: '624ee325-90f0-4912-ab82-28cc2917f779'

}

POST /api/v1/users/superUser 200 815.855 ms - 420

Unhandled rejection StatusCodeError: 400 - {"status":"error","message":"Invalid input JSON on line 1, column 120: Cannot deserialize instance of `java.util.ArrayList` out of START_OBJECT token","correlationId":"624ee325-90f0-4912-ab82-28cc2917f779"}

    at new StatusCodeError (/Volumes/projects/projects/Proedge_API/node_modules/request-promise-core/lib/errors.js:32:15)

    at Request.plumbing.callback (/Volumes/projects/projects/Proedge_API/node_modules/request-promise-core/lib/plumbing.js:104:33)

    at Request.RP$callback [as _callback] (/Volumes/projects/projects/Proedge_API/node_modules/request-promise-core/lib/plumbing.js:46:31)

    at Request.self.callback (/Volumes/projects/projects/Proedge_API/node_modules/request/request.js:185:22)

0 Upvotes
1 Reply 1
sasikumar
Participant

email api

now i was getting like these 

{

  status: 'error',

  message: 'Email is in a draft state -- portalId: 4740883, emailId: 36511889559',

  correlationId: '47abc0f1-9d18-464b-832b-69b631ab4976',

  sendResult: 'MISSING_CONTENT'

}

POST /api/v1/users 200 808.704 ms - 446

Unhandled rejection StatusCodeError: 400 - {"status":"error","message":"Email is in a draft state -- portalId: 4740883, emailId: 36511889559","correlationId":"47abc0f1-9d18-464b-832b-69b631ab4976","sendResult":"MISSING_CONTENT"}

0 Upvotes