# REST call to return entity ID

**URL:** <https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132>\
**Category:** Flow Production Tracking\
**Tags:** rest-api\
**Created:** [February 5, 2020, 5:12pm UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132 "2020-02-05T17:12:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dduffy](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dduffy](https://community.shotgridsoftware.com/u/dduffy)\
**Post date:** [February 5, 2020, 5:12pm UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132/1 "2020-02-05T17:12:26Z")

</div>

‘status’: 400,  
‘code’: 104,  
‘title’: ‘Create failed for [Version]. The value for the Version Name field is required to be unique.  
’,

Is it possible for this type of REST call to return the ID of the existing/clashing Version?

---

<div class="post-metadata">

**Author:** ![jing.liu](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/jing.liu/32/888_2.png) [@jing.liu](https://community.shotgridsoftware.com/u/jing.liu)\
**Post date:** [February 7, 2020, 1:39am UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132/2 "2020-02-07T01:39:47Z")

</div>

Hi,

Thanks for reaching us. What language do you use? This is the manual for [create a record](https://developer.shotgunsoftware.com/rest-api/#create-a-new-record).

Cheers

Loney

---

<div class="post-metadata">

**Author:** ![dduffy](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dduffy](https://community.shotgridsoftware.com/u/dduffy)\
**Post date:** [February 7, 2020, 10:36am UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132/3 "2020-02-07T10:36:22Z")

</div>

HI Jing

I’m using Python.  
I’m aware of how to create a new entity using REST API- my Q was if it is possible to obtain entity data in the return data of a pre-existing entity - when trying to create an entity(Version in this example)

---

<div class="post-metadata">

**Author:** ![brandon.foster](https://sea1.discourse-cdn.com/shotgunsoftware/user_avatar/community.shotgridsoftware.com/brandon.foster/32/91_2.png) [@brandon.foster](https://community.shotgridsoftware.com/u/brandon.foster)\
**Post date:** [February 7, 2020, 4:39pm UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132/4 "2020-02-07T16:39:26Z")

</div>

Hi @dduffy,

No, currently the API (REST or Python) does not return the ID of the conflicting record that violates the uniqueness constraint. I can definitely see how that would be useful, and I’d recommend [submitting it as an idea to our product team](https://community.shotgridsoftware.com/t/how-do-i-submit-an-idea-or-feature-request/253).

For the time being, you can do a try/catch for this sort of error in your creation call. If it occurs, you can then perform a quick `find` using the Version name you just tried to create to get this info and report it back to the script/log/user.

---

<div class="post-metadata">

**Author:** ![dduffy](https://avatars.discourse-cdn.com/v4/letter/d/bc8723/32.png) [@dduffy](https://community.shotgridsoftware.com/u/dduffy)\
**Post date:** [February 7, 2020, 5:25pm UTC](https://community.shotgridsoftware.com/t/rest-call-to-return-entity-id/7132/5 "2020-02-07T17:25:53Z")

</div>

Thanks Brandon

We are currently doing as you suggest with an additional find - was wondering if there was scope to catch the conflicting ID.

I’ll add to product team idea.

Cheers
