API Error Response Messages
The ProxyMesh API lets you programmatically manage elements of your account such as authorized IP addresses, hostnames, and proxies. At times, the API may send an error code response indicating that some part of an operation has failed. This article identifies common status codes returned by the API. API-related troubleshooting steps are suggested.
Response messages indicating success or failure begin with a 3-digit code. For certain errors, the 3-digit code can be followed by any one of several reasons, or message bodies, which further define the nature of the error. This helps you determine the solution.
The 3-digit codes are grouped into different classes, which can be identified by the first digit. Please click on the links below to read discussions of these response classes.
Code | Description | Comments and Resolution |
200 |
OK |
A successful request will return a 200 Status code, containing a JSON object such as {"ip": IP} . |
204 |
Success, No Content |
When you successfully delete an object, such as an IP address from your list of authenticated IP addresses, the system so indicates by returning an empty 204 response (that is, without a message body). |
302 |
moved temporarily |
HTTP request when HTTPS is required. If you send proxy server requests over HTTPS and these requests include custom headers, please see Proxy Server Requests over HTTPS for additional steps. |
400 |
Bad Request |
The response will include JSON error response body. Below are specific scenarios involving use of the ProxyMesh API. You should modify the request before repeating it. |
|
|
In the creation of a new sub-account using method POST /api/sub/create/ , or editing of a sub-account (method POST /api/sub/edit/ ), where the form data is invalid. |
In the addition of an authenticated hostname (method POST /api/hostname/add/ ), where a 400 response is returned if the IP is already authenticated. |
||
|
|
In the deletion of an authenticated hostname from your list (method POST /api/hostname/delete/ ), if the IP was not previously authenticated. |
|
|
In the addition of a proxy authorization (method POST /api/proxy/add/ ) or deletion of a proxy authorization (method POST /api/proxy/delete/ ), if proxy is not recognized. |
401 |
Basic Authentication Failure |
The request requires user authentication. You may repeat the request with a suitable Authorization header field. If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. Too many unauthenticated requests in a short period result in a temporary IP ban, which the proxy server uses to prevent apparent brute force attacks. You may authenticate your IP and resend the request after the ban expires. For more details, please see Basic access authentication. |
402 |
Payment required |
You will need to upgrade your plan to add more proxies or more sub-accounts. Or, if you have just signed up and you attempt to make frequent requests to the proxy’s API before receiving your confirmation email, this can trigger a 402 error code, resulting in a temporary block of 4 to 6 hours. Please note that ProxyMesh cannot manually remove this temporary block as the block is controlled by the hosting service or a remote site. You will need to wait until the temporary block is lifted before trying again. It's best not to make frequent requests to the proxy’s API. |
403 |
Forbidden |
Forbidden to complete API call. This can happen if you are authenticating as a sub-account, or if you are trying to modify a sub-account that isn't yours. The username field must match one of your existing sub-accounts. This error code can also indicate use of an incorrect API method, for example, requesting a list with POST when the method should be GET. |
404 |
Not Found |
In ProxyMesh services, the message body is "Sub-account not found." The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. The username field must match your account or one of your existing sub-accounts. You may also receive this response if you try to access a URL that is not available in the API. Triggering too many 404 responses in a short period of time may result in a temporary IP ban. |
405 |
Method Not Allowed |
An HTTP 405 error indicates a problem with your script and/or your web server. The error means that you are using the wrong HTTP method. GET and POST are the only allowed methods, and the correct method to use may depend on the specific API function. See Request Methods in Hypertext Transfer Protocol. |
500 |
Internal Server Error |
This indicates the ProxyMesh API server encountered an unexpected condition which prevented it from fulfilling the request. These conditions can often be resolved with a retry strategy. Best practice is to increase the delay between retries, and retry requests at least 3 times. Avoid timing your retries too closely together to give the error response time to expire from the target server. |
503 |
Plan error |
Unable to lookup subscription plan. Please try again in a few minutes. |