REST call to return entity ID

‘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?

2 Likes

Hi,

Thanks for reaching us. What language do you use? This is the manual for create a record.

Cheers

Loney

1 Like

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)

1 Like

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.

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.

1 Like

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

2 Likes