Table of Contents | ||
---|---|---|
|
Introduction
In Wordbee, numerous operations are conducted asynchronously.. This implies that when you submit a request, you are provided with an operation identifier (known as a "requestId"). Following this, your request is added to a queue for processing. The execution of your request will commence as soon as sufficient server resources become available. The actual timing of this process can vary, primarily depending on the existing workload on the Wordbee platform at the time of your request. Consequently, there may be varying degrees of delay in the execution of your request. Also see Asynchronous operations
...
It goes without saying that option 2 is the more efficient and modern approach.
Specifying a callback URL
Include in JSON BODY
Most asynchronous operations support setting callback URLs in the JSON BODY (if they do the documentation will say so). The parameters are:
| The callback URL. It may contain query parameters. The URL is called with HTTP POST. | string?, Optional | ||
| Permits to specify both a URL and HTTP headers.
Example:
| object?, Optional |
Include as URL query parameter
Alternatively, it is possible to set the callbackurl
as a URL query parameter. We recommend against this option unless the method does not allow to include JSON in the body.
...
Code Block | ||
---|---|---|
| ||
../contents/push?callbackurl=http%3A%2F%2Fcallmeback.mycompany.com%3Foperationid%3D22222%26mydata%3Dabcde |
Callback execution
When the operation completes with success or failure, the URL is called using HTTP POST and the operation details are included in the JSON body. See Asynchronous operations for the operation result properties.
Example
The method projects/{did}/documents/offline/export (POST) lets you export a file to XLIFF or WORD for offline translation. It is an asynchronous method.
...
Code Block |
---|
{ "trm": { "requestid": 559, "isbatch": false, "status": "Failed", "statusText": "Operation failed!", "statusInfo": "The parameter xy was not properly supplied" } } |
Using Basic Authentication
With the proper headers, callbacks authenticate with your server using the basic authentication protocol. Simply set the “Authorization” header and value. The value is the base-64 encoded credentials string “{username}:{password}”.
...