REST API: retrieve list of source strings by their ids

I am trying to uderstand if there’s a way to retrieve a list of source strings by their Ids.

There’s this nice List Language Translations that allows to specify several values in stringIds parameter. But there appears to be no similar endpoint for the source strings.

I am working with source strings that are associated with enormously large files, so just browsing the files is not really an option. However, we routinely refer in our team to certain strings by their Ids. So it makes sense to wish for a way to retrieve a list of, say, 20 source strings, given their Ids.

There appears to be no way also to achieve this through CroQL (ie, (id=1 or id=2 or id=3), as there’s no source string id in the context.

The only option left then is to retrieve the strings one by one, using the Get String endpoint. Which is manageable, but not that nice.

1 Like

Hello @Passiday!

But would the CroQL Context be suitable for you? The identifier can stand as the source string key.

If that’s not what you need, then Get String endpoint would be the only solution.

Let me know!

1 Like

Hi @DianaO !

For some strange reason, CroQL Source String Context does not include string id. Yes, identifier (I assume it is guaranteed to be a unique value in project scope?) is available there, but in our case that can not be used as alternative, as we are working with direct URLs to specific texts (like writing them in forum messages, emailing etc), and those URL contain string id that I am extracting for use in API requests.

1 Like

@Passiday,
The identifier has to be unique in the single file, otherwise the translations will be overwritten.

But in your case, I would suggest you use Get String - it’ll provide the unique id of the string.

2 Likes