run_id
, this endpoint allows you to retrieve the actual translations that were generated. Think of it as the pickup counter where you collect your finished translations after theyβve been processed.
How to Use This Endpoint
To retrieve your translated texts, send aGET
request to this endpoint with the run_id
you received when your translation task was marked as completed. This run_id
serves as your claim ticket for the finished translations. The system will respond with an array containing all your translated texts, preserving the same order as your original input.
Understanding the Response
When you call this endpoint, youβll receive a response that includes your translated content:texts
: An array of strings containing the translated output texts. Each item in this array corresponds to one of the original texts you submitted, maintaining the same order. This makes it easy to match translations with their original content.
Working with Translation Results
There are several common patterns for handling translation results effectively:Direct Integration
For immediate use, you can simply extract the texts array and use the translations in your application:Parallel Display
For applications that need to show both original and translated text together, you can zip the arrays:Saving to Database
For longer-term storage, you might want to save the translation results alongside their originals:Error Handling
When working with this endpoint, itβs important to handle potential error cases:- Invalid
run_id
: If the providedrun_id
doesnβt exist or has expired, the API will return an appropriate error message. - Expired Results: Translation results may be available for a limited time after completion. If too much time has passed, you may need to resubmit your translation request.
- Network Issues: As with any API call, network connectivity problems can interrupt the retrieval process, so implementing retry logic can improve reliability.
Next Steps
Once youβve retrieved your translations, you can:- Display them to your users
- Store them for future reference
- Process them further with additional NLP tools
- Use them in your application logic to enable multilingual functionality
Authorizations
The x-api-key
is a custom header required for authenticating requests to our API. Include this header in your request with the appropriate API key value to securely access our endpoints. You can find your API key(s) in the 'API' section of our studio website.
Path Parameters
The unique identifier for the run, which was generated during the translation creation process and returned upon task completion.
Response
Successful Response
The response is of type object
.