Some endpoint fields return backslash-escaped data

14 views
Skip to first unread message

d...@danmatthews.me

unread,
Sep 21, 2017, 10:06:17 AM9/21/17
to CATS API v3
Hi Guys.

Most notably, this has happened to me on the 'notes' field of a 'Candidate', if you add a string that contains an apostrophe or another typical character that requires escaping by a database, it'll return that string, escaped with a backslash:

Is this the actual desired behavior? As i don't think users of the API should have to deal with unescaping returned data.

Thanks,
Dan.

Anthony Allan

unread,
Sep 21, 2017, 5:09:37 PM9/21/17
to CATS API v3
Hey Dan,

The raw json that is sent by the API does not escape single quotes. That is something that is being done by whatever client you are using to process the API's response is doing.

d...@danmatthews.me

unread,
Sep 22, 2017, 2:47:10 AM9/22/17
to CATS API v3
Thanks Anthony, i noticed that it was returning even in a CURL request, but that may have been because of the double-encoding issue, i'll check it out. Thanks for the response.

Dan.

Anthony Allan

unread,
Sep 22, 2017, 10:22:42 AM9/22/17
to CATS API v3
If you're seeing the backslash in the cURL, it's possible that the data was inserted with a backslash in the first place.
Reply all
Reply to author
Forward
0 new messages