Get division by name

Hello,

I'm trying to receive division id by name using the GC API.
In our organization we have divisions test, test1, test2.

The following request returns all three divisions:

GET /api/v2/authorization/divisions?name=test

How should I modify it to receive only exact match (division "test")?

Thanks,
Irina

Hi Irina

Unfortunately there is no query parameter to specify an exact match, but if you are looking for "test" out of those three names, it will be the first item in the returned entities array, especially if you specify ?sortBy=name.

And of course, depending on how you are interacting with the API (via an sdk, etc.), you could loop through the returned data to perform an exact string comparison yourself.

Hope this helps
Charlie

Thank you, Charlie!

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.