Most of the records that create records return a response header named "location" with the URL to the record that was created. For example when creating a candidate:
$ curl -X POST \
>
https://api.catsone.com/v3/candidates?check_duplicate=true \
> -H 'authorization: Token ???????'' \
> -H 'content-type: application/json' \
> -d '{"first_name":"Kole","last_name":"Howe","emails":[{"is_primary":true,"email":"
te...@example.com"}]}' \
> -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 52.86.13.191:443...
* TCP_NODELAY set
* Connected to
api.catsone.com (52.86.13.191) port 443 (#0)
.....
< HTTP/2 201
< date: Fri, 26 Apr 2024 19:31:17 GMT
< content-type: text/html; charset=UTF-8
< location:
https://api.catsone.com/v3/candidates/403667268< x-rate-limit-limit: 500
< x-rate-limit-remaining: 494
< x-request-id: feef0ac3-3161-4aff-9267-05e0745dffad
The candidate's ID will be the part of the url following the last "/" character. Things do change a bit if you set check_duplicate=true and there is a duplicate:
>
https://api.catsone.com/v3/candidates?check_duplicate=true \
> -H 'authorization: Token ???????' \
> -H 'content-type: application/json' \
> -d '{"first_name":"Kole","last_name":"Howe","emails":[{"is_primary":true,"email":"
te...@example.com"}]}' \
> -v
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 34.226.128.103:443...
* TCP_NODELAY set
* Connected to
api.catsone.com (34.226.128.103) port 443 (#0)
....
< HTTP/2 409
< date: Fri, 26 Apr 2024 19:31:20 GMT
< content-type: application/json; charset=utf-8
< x-rate-limit-limit: 500
< x-rate-limit-remaining: 493
< x-request-id: b059b6c9-bf33-4afc-8241-1ba224d86590
<
* Connection #0 to host
api.catsone.com left intact
{"message":"Duplicate found.","data_item":{"type":"candidate","id":403667268}}
Now you get JSON response with the candidate_id.