<< Click to Display Table of Contents >> Navigation: 3. Script Language > AI - Artificial Intelligence Commands > AIC. - Artificial Intelligence Command > AI - Internet Commands > AI - Internet Commands |
MiniRobotLanguage (MRL)
AIC.Get http-Status
Get the HTTP-Status from last http-Request.
Intention
The AIC.Get http Status command is used to return the Status of the last http-Request from any such Operation, including
AIC.http-Request.
This command can be used to interface additional AI Services that may not yet be implemented using the SPR.
It can also be used for things that have nothing to do with AI-Services.
Technically the Command does exactly the same as
AIC.Get Several|4|$$RET
AIC.Get http-Status|$$RET
Here is a Table with the most common Status Codes and what they want to say.
These Status-Codes below are just a few examples, and the actual HTTP specification includes many more status codes.
If you are interested in a more comprehensive list, you may want to consult the official HTTP/1.1 specification or
other online resources that list all possible HTTP status codes.
Status Code |
Category |
Meaning |
200 |
Success |
The request was successful, and the server is sending the requested data. |
201 |
Success |
The request was successful, and a new resource was created as a result. |
204 |
Success |
The request was successful, but there's no representation to return (i.e. the response is empty). |
301 |
Redirection |
The requested URL has been moved permanently to another URL. The server will redirect the client to the new URL. |
302 |
Redirection |
The requested URL has been found but moved temporarily to another URL. The server will redirect the client to the new URL. |
400 |
Client Error |
The request could not be understood or was missing required parameters. |
401 |
Client Error |
The client must authenticate itself to get the requested response. |
403 |
Client Error |
The client does not have access rights to the content; that is, it is unauthorized, so the server is rejecting to give the requested resource. |
404 |
Client Error |
The server can not find the requested resource. This code is most often used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable. |
500 |
Server Error |
The server has encountered a situation it doesn't know how to handle. |
502 |
Server Error |
The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. |
503 |
Server Error |
The server is not ready to handle the request, often because it is overloaded or under maintenance. |
Some of the most used Status-Codes.
HTTP Status Code |
Description |
400 |
Invalid request: There was an issue with the format or content of your request. |
401 |
Unauthorized: There's an issue with your API key. |
403 |
Forbidden: Your API key does not have permission to use the specified resource. |
404 |
Not found: The requested resource was not found. |
429 |
Too Many Requests: Your account has hit a rate limit. |
500 |
Internal Server Error: An unexpected error has occurred internal to Anthropic's systems. |
529 |
Service Unavailable: Anthropic's API is temporarily overloaded. |
Depending on the availability of the Claude 2 API, we will also support this AI-System.
In that case here are the error-values you could get there.
More general Information on Status-Codes:
Internet-Link: HTPP-Status-Codes
HTTP status codes are utilized to signal errors. It's crucial that your application is designed to appropriately respond to these errors. For guidance, refer to the status code results expected for each endpoint, as outlined in the endpoint documentation.
The following HTTP status codes require particular attention:
HTTP Status Code |
Description |
Recommended Action |
429 |
Too many requests |
Configure your application to delay and resend the request instead of continuously resending it. If you're experiencing frequent 429 errors and wish to enhance your translation speed, reach out to support@DeepL.com. |
456 |
Quota exceeded |
Your account's translation limit has been met. Consider upgrading your subscription. |
500 and above |
Temporary errors in the DeepL service |
Set up your application to delay and resend the request instead of continuously resending it. If the error continues for an extended period, please contact support@DeepL.com. |
When resending failed requests, your application should employ an exponential-backoff strategy, which increases the delay time with each subsequent failed request. All official DeepL client libraries incorporate this strategy and can serve as a reference.
The service's responsiveness adjusts dynamically based on system load. Once errors subside, you can resume sending more requests. As the service adjusts, you'll be able to send an increasing number of requests within a certain timeframe without encountering errors. If you're unable to achieve your desired translation speed or if you're receiving an excessive number of 429 errors, please contact support@DeepL.com for further investigation.
Additional details about the error may be provided in a JSON response. If available, this extra information will be found in the 'message' key.
Source:
DeepLl.com specific Status-Code:
Here is a Sample of a Script that runs and returns a statuscode.
' Make http-Request and receive answer
$$URL=https://api.openai.com
AIC.http request|get|$$URL||Accept=application/json$crlf$User-Agent=MyApp
POP.$$TOS
AIC.Get Several|4|$$RET
MBX.Received $$RET
ENR.
Syntax
AIC.Get http-Status|P1
AIC.Ghs|P1
Parameter Explanation
P1 - <Variable>: Variable to return the Status-Code, prefixed by "Statuscode: ".
Example
'*****************************************************
' EXAMPLE 1: AIC.-Commands
' ' This is just a Syntax Sample the Script does not make anything useful
'*****************************************************
' Make http-Request and receive answer
$$URL=https://api.openai.com
AIC.http request|get|$$URL||Accept=application/json$crlf$User-Agent=MyApp
POP.$$TOS
AIC.Get Several|4|$$RET
MBX.Received $$RET
ENR.
Remarks
-
Limitations:
-
See also:
• Set_Key
• Ask_Chat