Skip to content

Commit f425fb2

Browse files
consolidate API routing pages
1 parent 2c0bec4 commit f425fb2

File tree

3 files changed

+58
-92
lines changed

3 files changed

+58
-92
lines changed

public/__redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@
210210
# api-shield
211211
/api-shield/security/sequential-abuse-detection/ /api-shield/security/sequence-analytics/ 301
212212
/api-shield/security/bola-attack-detection/ /api-shield/security/bola-vulnerability-detection/ 301
213+
/api-shield/management-and-monitoring/api-routing/configure/ /api-shield/management-and-monitoring/api-routing/ 301
213214

214215
#autorag
215216
/autorag/usage/recipes/ /autorag/how-to/ 301

src/content/docs/api-shield/management-and-monitoring/api-routing/configure.mdx

Lines changed: 0 additions & 92 deletions
This file was deleted.

src/content/docs/api-shield/management-and-monitoring/api-routing/index.mdx

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,79 @@ Once your Source Endpoints are added to Endpoint Management, use the following s
2424

2525
### Create a route
2626

27+
#### Via the Cloudflare dashboard
28+
2729
<Render file="routing" params={{ one: "Create", two: "route" }} />
2830

31+
#### Via the API
32+
33+
```bash title="cURL command"
34+
curl --request PUT "https://api.cloudflare.com/client/v4/zones/{zoneID}/api_gateway/operations/{operationID}/route" \
35+
--header "Content-Type: application/json" \
36+
--data '{"route": "https://api.example.com/api/service"}'
37+
```
38+
39+
```json title="Response"
40+
{
41+
"result": {
42+
"route": "https://api.example.com/api/service"
43+
},
44+
"success": true,
45+
"errors": [],
46+
"messages": []
47+
}
48+
```
49+
2950
<Render file="routing-path-variables" />
3051

3152
### Edit a route
3253

3354
<Render file="routing" params={{ one: "Edit", two: "routing" }} />
3455

56+
### Verify a Route
57+
58+
```bash title="cURL command"
59+
curl --request GET "https://api.cloudflare.com/client/v4/zones/{zoneID}/api_gateway/operations/{operationID}/route" \
60+
--header "Content-Type: application/json"
61+
```
62+
63+
```json title="Response"
64+
{
65+
"result": {
66+
"route": "https://api.example.com/api/service"
67+
},
68+
"success": true,
69+
"errors": [],
70+
"messages": []
71+
}
72+
```
73+
3574
### Remove a route
3675

76+
#### Via the Cloudflare dashboard
77+
3778
1. Log in to the [Cloudflare dashboard](https://dash.cloudflare.com/) and select your account and domain.
3879
2. Select **Security** > **API Shield**.
3980
3. In **Endpoint Management**, select an existing endpoint and expand its details.
4081
4. Under **Routing**, select **Edit routing**.
4182
5. Select **Delete route**.
4283

84+
#### Via the API
85+
86+
```bash title="cURL command"
87+
curl --request DELETE "https://api.cloudflare.com/client/v4/zones/{zoneID}/api_gateway/operations/{operationID}/route" \
88+
--header "Content-Type: application/json"
89+
```
90+
91+
```json title="Response"
92+
{
93+
"result":{},
94+
"success":true,
95+
"errors":[],
96+
"messages":[]
97+
}
98+
```
99+
43100
### Test a route
44101

45102
After sending a request to your Source Endpoint, you should see the contents of the back-end service as if you called the Target Endpoint directly.

0 commit comments

Comments
 (0)