# Get ID of existing record

**URL:** <https://api-discuss.freeagent.com/t/get-id-of-existing-record/323>\
**Category:** Uncategorized\
**Created:** [16 April 2014 21:24 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323 "2014-04-16T21:24:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikas\_Agrawal](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/v/58f4c7/32.png) [@Vikas\_Agrawal](https://api-discuss.freeagent.com/u/Vikas_Agrawal)\
**Post date:** [16 April 2014 21:24 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/1 "2014-04-16T21:24:49Z")

</div>

The response to

[https://api.freeagent.com/v2/contacts?view=active](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](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](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?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [17 April 2014 08:41 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/2 "2014-04-17T08:41:07Z")

</div>

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](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](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](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?

---

<div class="post-metadata">

**Author:** ![Vikas\_Agrawal](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/v/58f4c7/32.png) [@Vikas\_Agrawal](https://api-discuss.freeagent.com/u/Vikas_Agrawal)\
**Post date:** [22 April 2014 10:09 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/3 "2014-04-22T10:09:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [21 April 2014 08:07 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/4 "2014-04-21T08:07:47Z")

</div>

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](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](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](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?

---

<div class="post-metadata">

**Author:** ![Vikas\_Agrawal](https://api-discuss.freeagent.com/letter_avatar_proxy/v4/letter/v/58f4c7/32.png) [@Vikas\_Agrawal](https://api-discuss.freeagent.com/u/Vikas_Agrawal)\
**Post date:** [19 April 2014 06:03 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/5 "2014-04-19T06:03:12Z")

</div>

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](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](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](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?

---

<div class="post-metadata">

**Author:** ![Jonathan\_Barrett](https://api-discuss.freeagent.com/user_avatar/api-discuss.freeagent.com/jonathan_barrett/32/150_2.png) [@Jonathan\_Barrett](https://api-discuss.freeagent.com/u/Jonathan_Barrett)\
**Post date:** [22 April 2014 10:20 UTC](https://api-discuss.freeagent.com/t/get-id-of-existing-record/323/6 "2014-04-22T10:20:56Z")

</div>

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
