You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/rest-apis/gateway/webbroker-api-management.md
+351Lines changed: 351 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -562,3 +562,354 @@ Status Code **200**
562
562
|» status|string|false|none|none|
563
563
|» message|string|false|none|none|
564
564
|» id|string|false|none|none|
565
+
566
+
## Create a new API key for a WebBroker API
567
+
568
+
<aid="opIdcreateWebBrokerAPIKey"></a>
569
+
570
+
`POST /webbroker-apis/{id}/api-keys`
571
+
572
+
> Code samples
573
+
574
+
```shell
575
+
576
+
curl -X POST http://localhost:9090/api/management/v0.9/webbroker-apis/{id}/api-keys \
577
+
-u {username}:{password} \
578
+
-H 'Content-Type: application/json' \
579
+
-H 'Accept: application/json' \
580
+
-d @payload.json
581
+
582
+
```
583
+
584
+
Generate a new API key for a WebBroker API in the Gateway. The key is a 32-byte random value encoded in hexadecimal, prefixed with `apip_`. Use the API Key policy on the API to validate incoming requests with this key.
585
+
586
+
> Payload
587
+
588
+
```json
589
+
{
590
+
"name": "my-production-key"
591
+
}
592
+
```
593
+
594
+
### Authentication
595
+
596
+
<asideclass="warning">
597
+
This operation requires <strong>Basic Auth</strong> authentication.
|201|[Created](https://tools.ietf.org/html/rfc7231#section-6.3.2)|API key created successfully|[APIKeyCreationResponse](schemas.md#schemaapikeycreationresponse)|
curl -X POST http://localhost:9090/api/management/v0.9/webbroker-apis/{id}/api-keys/{apiKeyName}/regenerate \
719
+
-u {username}:{password} \
720
+
-H 'Content-Type: application/json' \
721
+
-H 'Accept: application/json' \
722
+
-d @payload.json
723
+
724
+
```
725
+
726
+
Regenerate an existing API key for a WebBroker API in the Gateway. The previous key is revoked and replaced with a new 32-byte random value encoded in hexadecimal, prefixed with `apip_`.
727
+
728
+
> Payload
729
+
730
+
```json
731
+
{}
732
+
```
733
+
734
+
### Authentication
735
+
736
+
<asideclass="warning">
737
+
This operation requires <strong>Basic Auth</strong> authentication.
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|WebBroker API or API key not found|[ErrorResponse](schemas.md#schemaerrorresponse)|
781
+
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal server error|[ErrorResponse](schemas.md#schemaerrorresponse)|
782
+
783
+
## Update an API key for a WebBroker API
784
+
785
+
<aid="opIdupdateWebBrokerAPIKey"></a>
786
+
787
+
`PUT /webbroker-apis/{id}/api-keys/{apiKeyName}`
788
+
789
+
> Code samples
790
+
791
+
```shell
792
+
793
+
curl -X PUT http://localhost:9090/api/management/v0.9/webbroker-apis/{id}/api-keys/{apiKeyName} \
794
+
-u {username}:{password} \
795
+
-H 'Content-Type: application/json' \
796
+
-H 'Accept: application/json' \
797
+
-d @payload.json
798
+
799
+
```
800
+
801
+
Update an API key with a custom value instead of auto-generating one.
802
+
803
+
> Payload
804
+
805
+
```json
806
+
{
807
+
"displayName": "Updated",
808
+
"apiKey": "custom-key-999",
809
+
"issuer": "portal"
810
+
}
811
+
```
812
+
813
+
### Authentication
814
+
815
+
<asideclass="warning">
816
+
This operation requires <strong>Basic Auth</strong> authentication.
|404|[Not Found](https://tools.ietf.org/html/rfc7231#section-6.5.4)|WebBroker API or API key not found|[ErrorResponse](schemas.md#schemaerrorresponse)|
860
+
|409|[Conflict](https://tools.ietf.org/html/rfc7231#section-6.5.8)|Conflict (duplicate key or conflicting update)|[ErrorResponse](schemas.md#schemaerrorresponse)|
861
+
|500|[Internal Server Error](https://tools.ietf.org/html/rfc7231#section-6.6.1)|Internal server error|[ErrorResponse](schemas.md#schemaerrorresponse)|
0 commit comments