REST stands for Representational State Transfer, and it's a set of principles that define how web standards, like HTTP and URI, should be used. A REST route refers to a specific URL pattern in a web application that is handled by a particular function or method. These routes are the endpoints of a RESTful API and correspond to specific operations based on the HTTP methods (GET, POST, PUT, DELETE, etc.) used.
Reasons why REST route may be blocked
Firewall or Security Groups
Sometimes security measures may block incoming requests to certain IP addresses or ports. If the server running the REST API is behind a firewall or inside a network with strict security rules, certain requests might not reach the server.
CORS (Cross-Origin Resource Sharing) Policy
This is a security measure implemented in web browsers to prevent requests from being made between different domains, unless explicitly allowed by the server. If a REST route is being accessed from a different domain, and the server does not allow it, then the request will be blocked.
Rate Limiting
To protect the server from being overwhelmed by too many requests, some APIs implement rate limiting. If too many requests are sent in a certain period of time, subsequent requests may be blocked.
Authentication/Authorization
If the route requires certain authentication or authorization and the request does not meet these criteria, the request will be denied.
IP Blocking
The server may be set to block requests from certain IP addresses, usually as a security measure.
How to check if the REST route is blocked
To check if the REST route is blocked, navigate to Get URL with Curl and check these two links:
curl https://yourdomain.com/?rest_route=/tenweb/v1/get_check
curl -X POST https://yourdomain.com/?rest_route=/tenweb/v1/post_check,
replacing yourdomain.com with your website URL.
If you receive {“code”:“ok”}, then the route is functioning. If you get anything different (like rest no route), you will need to fix your REST route.
How to fix a blocked REST route
If you check your REST route and get anything other than “code”:”ok” you can try fixing the REST route by:
- Deactivating any security plugin/service that might affect the API or REST
Next check if your REST route is blocked using the above instructions.
If this doesn’t work, then:
- Contact your hosting service provider and ask them to whitelist our IP addresses listed below.
10Web IP addresses
52.170.74.61
52.142.61.111
20.98.84.151
13.92.59.87
52.151.28.87
40.117.75.176
40.114.115.187
13.66.227.49