Rest API and JS format for 'id' are different

Posted in General by James Gentes Tue Sep 22 2015 17:07:50 GMT+0000 (UTC)·1·Viewed 927 times

Finally figured this out.. if you use the REST API to 'upsert' a record, the 'id' must be placed under "data", like so: knowtifyClient.contacts.upsert({ "contacts": [ { "email": email, "data": { "id": id } } ] }); Whereas in the JS client, you can place 'id' next to email: _knowtify.push(['add_contact', { email: email, id: id, }]); This is super confusing and took me a lot of troubleshooting to figure out. :(
Derek Skaletsky
Sep 23, 2015

Hi James -

Thanks for the comment. You are right, this is confusing. It makes sense for the ID to be placed in the same relative place for both calls. We'll look into that.

Thanks!

  
Markdown is allowed