Rest API and JS format for 'id' are different

Posted in General by James Gentes Tue Sep 22 2015 17:07:50 GMT+0000 (Coordinated Universal Time)·1·Viewed 1,410 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. :(
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.


Markdown is allowed