Get ID of existing record

The response to

https://api.freeagent.com/v2/contacts?view=active does not seem to return any sort of Id to request for or work with the same record again.
https://api.freeagent.com/v2/contacts/:id provides for an Id but where can I get the Id.

While creating I suspect the response returns the id

https://api.freeagent.com/v2/contacts/70

Is 70 the Id returned when a new one is created? How do I get this Id for an existing record so that I can interact with it in future?

Hi Vikas,

The response to your contacts query should contain a “URL” for each
contact. This is the unique identifier you need for the resource.

-JOn Wednesday, 16 April 2014 22:24:49 UTC+1, Vikas Agrawal wrote:

The response to

https://api.freeagent.com/v2/contacts?view=active does not seem to return any sort of Id to request for or work with the same record again.
https://api.freeagent.com/v2/contacts/:id provides for an Id but where can I get the Id.

While creating I suspect the response returns the id

https://api.freeagent.com/v2/contacts/70

Is 70 the Id returned when a new one is created? How do I get this Id for an existing record so that I can interact with it in future?

To put it other way,
Will it do if i store just 70 or the numeric part at the end of the url.
That would be simpler identifier and more efficient to search in database.
It would be good to know If there is a reason to store full url.

Hi Vikas,

Glad I could help. Not sure what you mean about wishing there was “just an
ID”, though: the URL is the ID, as far as the API is concerned.

-JOn Saturday, 19 April 2014 07:03:12 UTC+1, Vikas Agrawal wrote:

Thanks.
Case of missing something “right in front of your eyes”.
I do wish that there was just an Id instead of url.

On Thursday, April 17, 2014 2:11:07 PM UTC+5:30, Jonathan Barrett wrote:

Hi Vikas,

The response to your contacts query should contain a “URL” for each
contact. This is the unique identifier you need for the resource.

-J

On Wednesday, 16 April 2014 22:24:49 UTC+1, Vikas Agrawal wrote:

The response to

https://api.freeagent.com/v2/contacts?view=active does not seem to return any sort of Id to request for or work with the same record again.
https://api.freeagent.com/v2/contacts/:id provides for an Id but where can I get the Id.

While creating I suspect the response returns the id

https://api.freeagent.com/v2/contacts/70

Is 70 the Id returned when a new one is created? How do I get this Id for an existing record so that I can interact with it in future?

Thanks.
Case of missing something “right in front of your eyes”.
I do wish that there was just an Id instead of url.On Thursday, April 17, 2014 2:11:07 PM UTC+5:30, Jonathan Barrett wrote:

Hi Vikas,

The response to your contacts query should contain a “URL” for each
contact. This is the unique identifier you need for the resource.

-J

On Wednesday, 16 April 2014 22:24:49 UTC+1, Vikas Agrawal wrote:

The response to

https://api.freeagent.com/v2/contacts?view=active does not seem to return any sort of Id to request for or work with the same record again.
https://api.freeagent.com/v2/contacts/:id provides for an Id but where can I get the Id.

While creating I suspect the response returns the id

https://api.freeagent.com/v2/contacts/70

Is 70 the Id returned when a new one is created? How do I get this Id for an existing record so that I can interact with it in future?

Hi Vikas,

You can store the “70” at your end if you want, but you’ll obviously then
need to reconstruct the URL any time you need to access or refer to the
resource, which means your app is going to need to understand how to
construct URLs for any resource you need to know about.

As I say, the URL is the ID of the resource as far as the API is concerned,
as it contains everything the API needs to be sure of what “70” you mean
(contact, project etc) and is guaranteed to be unique even across
sandbox/production environments.

-J