Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump REST API versions for 4.3.0 #7615

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,20 +87,20 @@ Here are the steps to revoke an API Key.

2. Generate an API Key from API-M by following the steps in [Secure APIs with API Keys]({{base_path}}/design/api-security/api-authentication/secure-apis-using-api-keys).

3. Get an access token to the Control Plane (API-M) by referring to [this section]({{base_path}}/reference/product-apis/devportal-apis/devportal-v3/devportal-v3/#section/Authentication). Remember to include `apim:api_key` as a scope when requesting the access token.
3. Get an access token to the Control Plane (API-M) by referring to [this section]({{base_path}}/reference/product-apis/devportal-apis/devportal-v4/devportal-v4/#section/Authentication). Remember to include `apim:api_key` as a scope when requesting the access token.

4. Revoke the API Key by calling the following API from the Control Plane.

``` tab="Format"
curl -k -v -H "Authorization: Bearer <access-token-for-API-M-REST-API>" -d '{ "apikey" : "<API-Key-to-revoke>" }' -H "Content-Type: application/json" "https://localhost:9443/api/am/devportal/v3/applications/<application-ID>/api-keys/<key-type>/revoke"
curl -k -v -H "Authorization: Bearer <access-token-for-API-M-REST-API>" -d '{ "apikey" : "<API-Key-to-revoke>" }' -H "Content-Type: application/json" "https://localhost:9443/api/am/devportal/v4/applications/<application-ID>/api-keys/<key-type>/revoke"
```

``` tab="Example"
curl -k -H "Authorization: Bearer e4cb79d6-c22e-386a-a1eb-0494208e9976" -H "Content-Type: application/json" -X POST -d '{ "apikey" : "eyJ4NXQiOiJOMkpqTWpOaU0yRXhZalJrTnpaalptWTFZVEF4Tm1GbE5qZzRPV1UxWVdRMll6YzFObVk1TlE9PSIsImtpZCI6ImdhdGV3Y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jHk6boJNtGBV1XUioJ-IQwq2MnBOII3dRbePYA7hNICmlOWaVXDOZitpihTiIl1JUHT7a_nGDiXg3b-MC14PqrdrAnqNWxih_K6oiVrlulsAaVWhRr3dmTQcsA4Eqr2N9FMHDRPeUT8MKlCpy7_SZeWX207LkwdnvWSVrV6dNPJuAWU1g8my_MYQlDDltZqKaisw==" }' "https://localhost:9443/api/am/devportal/v3/applications/93921368-ebdd-41c1-9b67-e38efcdfc320/api-keys/PRODUCTION/revoke"
curl -k -H "Authorization: Bearer e4cb79d6-c22e-386a-a1eb-0494208e9976" -H "Content-Type: application/json" -X POST -d '{ "apikey" : "eyJ4NXQiOiJOMkpqTWpOaU0yRXhZalJrTnpaalptWTFZVEF4Tm1GbE5qZzRPV1UxWVdRMll6YzFObVk1TlE9PSIsImtpZCI6ImdhdGV3YXlfY2VydGlmaWNhdGVfYWxpYXMiLCJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJhZG1pbkBjYXJib24uc3VwZXIiLCJhcHBsaWNhdGlvbiI6eyJvd25lciI6ImFkbWluIiwidGllclF1b3RhVHlwZSI6bnVsbCwidGllciI6IjEwUGVyTWluIiwibmFtZSI6Im15IiwiaWQiOjIsInV1aWQiOiI5MzkyMTM2OC1lYmRkLTQxYzEtOWI2Ny1lMzhlZmNkZmMzMjAifSwiaXNzIjoiaHR0cHM6XC9cL2FwaW06OTQ0NFwvb2F1dGgyXC90b2tlbiIsInRpZXJJbmZvIjp7IlVubGltaXRlZCI6eyJ0aWVyUXVvdGFUeXBlIjoicmVxdWVzdENvdW50IiwiZ3JhcGhRTE1heENvbXBsZXhpdHkiOjAsImdyYXBoUUxNYXhEZXB0aCI6MCwic3RvcE9uUXVvdGFSZWFjaCI6dHJ1ZSwic3Bpa2VBcnJlc3RMaW1pdCI6MCwic3Bpa2VBcnJlc3RVbml0IjpudWxsfX0sImtleXR5cGUiOiJQUk9EVUNUSU9OIiwic3Vic2NyaWJlZEFQSXMiOlt7InN1YnNjcmliZXJUZW5hbnREb21haW4iOiJjYXJib24uc3VwZXIiLCJuYW1lIjoicXFxcSIsImNvbnRleHQiOiJcL3FxcVwvMSIsInB1Ymxpc2hlciI6ImFkbWluIiwidmVyc2lvbiI6IjEiLCJzdWJzY3JpcHRpb25UaWVyIjoiVW5saW1pdGVkIn1dLCJ0b2tlbl90eXBlIjoiYXBpS2V5IiwiaWF0IjoxNjUwMzY0MjYyLCJqdGkiOiJlYzYxZDI0Zi04Nzg2LTRlYjktYmZiNy1lN2EyMGQwMjk1ZjYifQ==.M6ZiC1asUawlx73JYU83knl6vm1AG1q95DKnk-mU_59UG1yTRMJDtQn0CpHNDlTb-w9P4JGY8H5Z6l-aLUsmlyDAgIDG58_Q264jYqXleinRlOQyeAkQrPUM4DlVqM9yKOM-xLB8ZrE8feMj6-jHk6boJNtGBV1XUioJ-IQwq2MnBOII3dRbePYA7hNICmlOWaVXDOZitpihTiIl1JUHT7a_nGDiXg3b-MC14PqrdrAnqNWxih_K6oiVrlulsAaVWhRr3dmTQcsA4Eqr2N9FMHDRPeUT8MKlCpy7_SZeWX207LkwdnvWSVrV6dNPJuAWU1g8my_MYQlDDltZqKaisw==" }' "https://localhost:9443/api/am/devportal/v4/applications/93921368-ebdd-41c1-9b67-e38efcdfc320/api-keys/PRODUCTION/revoke"
```

!!! info
Refer to [Developer Portal - Revoke API Key]({{base_path}}/reference/product-apis/devportal-apis/devportal-v3/devportal-v3/#tag/API-Keys/paths/~1applications~1{applicationId}~1api-keys~1{keyType}~1revoke/post) section for more info.
Refer to [Developer Portal - Revoke API Key]({{base_path}}/reference/product-apis/devportal-apis/devportal-v4/devportal-v4/#tag/API-Keys/paths/~1applications~1{applicationId}~1api-keys~1{keyType}~1revoke/post) section for more info.

The above command will return an empty 200 response.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This section explains how to add a custom workflow to control the API state chan
service_url = "https://localhost:9445/bpmn"
username = "$ref{super_admin.username}"
password = "$ref{super_admin.password}"
callback_endpoint = "https://localhost:${mgt.transport.https.port}/api/am/admin/v0.15/workflows/update-workflow-status"
callback_endpoint = "https://localhost:${mgt.transport.https.port}/api/am/admin/v5/workflows/update-workflow-status"
oken_endpoint = "https://localhost:${https.nio.port}/token"
client_registration_endpoint = "https://localhost:${mgt.transport.https.port}/client-registration/v0.15/register"
client_registration_username = "$ref{super_admin.username}"
Expand Down Expand Up @@ -175,7 +175,7 @@ enable = true
service_url = "https://localhost:9445/bpmn"
username = "$ref{super_admin.username}"
password = "$ref{super_admin.password}"
callback_endpoint = "https://localhost:${mgt.transport.https.port}/api/am/admin/v0.15/workflows/update-workflow-status"
callback_endpoint = "https://localhost:${mgt.transport.https.port}/api/am/admin/v5/workflows/update-workflow-status"
oken_endpoint = "https://localhost:${https.nio.port}/token"
client_registration_endpoint = "https://localhost:${mgt.transport.https.port}/client-registration/v0.15/register"
client_registration_username = "$ref{super_admin.username}"
Expand Down
6 changes: 3 additions & 3 deletions en/docs/design/api-monetization/monetizing-an-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ You can use the admin REST API, which is available in WSO2 API Manager, to publi

1. Obtain the consumer key and secret key pair by calling the dynamic client registration endpoint.

For more information, see [Admin REST API v4.0]({{base_path}}/reference/product-apis/admin-apis/admin-v4/admin-v4/).
For more information, see [Admin REST API v5.0]({{base_path}}/reference/product-apis/admin-apis/admin-v5/admin-v5/).

``` java
curl -X POST -H "Authorization: Basic <base64encoded-admin-account-credentials>" -H "Content-Type: application/json" -d @payload.json https://localhost:9443/client-registration/v0.17/register
Expand All @@ -721,7 +721,7 @@ You can use the admin REST API, which is available in WSO2 API Manager, to publi
3. Publish usage data to the Stripe billing engine.

``` java
curl -k -H "Authorization: Bearer <monetization-usage-publish-token>" -X POST -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v1/monetization/publish-usage
curl -k -H "Authorization: Bearer <monetization-usage-publish-token>" -X POST -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v5/monetization/publish-usage
```

- `<monetization-usage-publish-token>` - Token obtained using client credentials with `monetization_usage_publish` scope in the previous step.
Expand All @@ -741,7 +741,7 @@ You can use the admin REST API, which is available in WSO2 API Manager, to publi
When you call the Admin API to publish usage data, a separate job in a separate thread is created to publish usage data to the billing engine. The status of the above job can be monitored as follows.

``` java
curl -k -H "Authorization: Bearer <monetization-usage-publish-token>" -X GET -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v1/monetization/publish-usage/status
curl -k -H "Authorization: Bearer <monetization-usage-publish-token>" -X GET -H "Content-Type: application/json" https://localhost:9443/api/am/admin/v5/monetization/publish-usage/status
```
- `<monetization-usage-publish-token>` - The same token that you got with the monetization usage scope in previous steps.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Carry out the following steps to configure NGINX as the load balancer to support
proxy_redirect https://{server-IP}:9443/devportal/ /;
proxy_set_header X-WSO2-Tenant "{tenant-domain}";
}
location ~ (/api/am/devportal/v3|/authenticationendpoint|/logincontext|/commonauth|/oidc) {
location ~ (/api/am/devportal/v4|/authenticationendpoint|/logincontext|/commonauth|/oidc) {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down Expand Up @@ -154,7 +154,7 @@ Carry out the following steps to configure NGINX as the load balancer to support
proxy_redirect https://192.168.1.8:9443/devportal/ /;
proxy_set_header X-WSO2-Tenant "wso2.com";
}
location ~ (/api/am/devportal/v3|/authenticationendpoint|/logincontext|/commonauth|/oidc) {
location ~ (/api/am/devportal/v4|/authenticationendpoint|/logincontext|/commonauth|/oidc) {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Initially, the Admins will define API categories. Thereafter, API providers will
You can add an API category using any of the following methods:

- [Add an API Category using the Admin Portal UI]({{base_path}}/develop/customizations/customizing-the-developer-portal/customize-api-listing/api-category-based-grouping/#add-an-api-category-using-the-admin-portal-ui)
- Add an API Category using the Admin REST API. (You can use the POST resource in the **API Category (Individual)** section [here]({{base_path}}/reference/product-apis/admin-apis/admin-v4/admin-v4))
- Add an API Category using the Admin REST API. (You can use the POST resource in the **API Category (Individual)** section [here]({{base_path}}/reference/product-apis/admin-apis/admin-v5/admin-v5))

### Add an API Category using the Admin Portal UI

Expand Down Expand Up @@ -67,4 +67,4 @@ You can add an API category using any of the following methods:

All APIs that belong to the selected category appear.

[![APIs categorised based on API category]({{base_path}}/assets/img/develop/devportal_listing.png)]({{base_path}}/assets/img/develop/devportal_listing.png)
[![APIs categorized based on API category]({{base_path}}/assets/img/develop/devportal_listing.png)]({{base_path}}/assets/img/develop/devportal_listing.png)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To customize the default workflow extension, you override the **`execute()`** an
   public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException {
       super.execute(workflowDTO);
```
4. In the **`execute()`** method define the `CallbackUrl`, `RedirectUrl`, `workflowRefId`, and `RedirectConfirmationMsg`. The CallbackUrl should ideally be an open endpoint accepting workflowRefId as a parameter. Once the endpoint is invoked, it should in-turn invoke the [Admin REST APIs callback method]({{base_path}}/reference/product-apis/admin-apis/admin-v4/admin-v4/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post). Note that the Admin REST API resources require authentication before invocation.
4. In the **`execute()`** method define the `CallbackUrl`, `RedirectUrl`, `workflowRefId`, and `RedirectConfirmationMsg`. The CallbackUrl should ideally be an open endpoint accepting workflowRefId as a parameter. Once the endpoint is invoked, it should in-turn invoke the [Admin REST APIs callback method]({{base_path}}/reference/product-apis/admin-apis/admin-v5/admin-v5/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post). Note that the Admin REST API resources require authentication before invocation.
``` java
@Override
   public WorkflowResponse execute(WorkflowDTO workflowDTO) throws WorkflowException {
Expand Down Expand Up @@ -244,4 +244,4 @@ To customize the default workflow extension, you override the **`execute()`** an
```
### Invoking the API Manager from a third party BPEL engine

The API Manager can be invoked from a third party entity through the [update workflow status method]({{base_path}}/reference/product-apis/admin-apis/admin-v4/admin-v4/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post). Refer the [Admin REST APIs]({{base_path}}/develop/product-apis/admin-apis/admin-v1/admin-v1/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post) to learn how to invoke it. Note that the Admin REST API resources require authentication before invocation.
The API Manager can be invoked from a third party entity through the [update workflow status method]({{base_path}}/reference/product-apis/admin-apis/admin-v5/admin-v5/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post). Refer the [Admin REST APIs]({{base_path}}/develop/product-apis/admin-apis/admin-v5/admin-v5/#tag/Workflows-(Individual)/paths/~1workflows~1update-workflow-status/post) to learn how to invoke it. Note that the Admin REST API resources require authentication before invocation.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ In this guide, you access the Admin Portal ( `https://:9443/admin` ) Web applic
<send>
<endpoint>
<http method="POST"
uri-template="https://<PUBLISHER_IP>:9443/api/am/admin/v0.16/workflows/update-workflow-status?workflowReferenceId={uri.var.workflowRef}"/>
uri-template="https://<PUBLISHER_IP>:9443/api/am/admin/v5/workflows/update-workflow-status?workflowReferenceId={uri.var.workflowRef}"/>
</endpoint>
</send>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Once the workflow configurations are finalized at the BPEL, the call-back URL of
</tr>
<tr class="even">
<td>REST</td>
<td><a href="https://localhost:9443/api/am/admin/v2/workflows/update-workflow-status" class="uri">https://localhost:9443/api/am/admin/v2/workflows/update-workflow-status</a></td>
<td><a href="https://localhost:9443/api/am/admin/v5/workflows/update-workflow-status" class="uri">https://localhost:9443/api/am/admin/v5/workflows/update-workflow-status</a></td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -65,7 +65,7 @@ The endpoint expects the following list of parameters:
A sample curl request for invoking the REST endpoint is as follows:

```
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -X POST https://localhost:9443/api/am/admin/v2/workflows/update-workflow-status -d 'workflowReference=b530be39-9174-43b3-acb3-2603a223b094&status=APPROVED&description=DESCRIPTION'
curl -H "Authorization:Basic YWRtaW46YWRtaW4=" -X POST https://localhost:9443/api/am/admin/v5/workflows/update-workflow-status -d 'workflowReference=b530be39-9174-43b3-acb3-2603a223b094&status=APPROVED&description=DESCRIPTION'
```

A sample SOAP request is given below:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
template: templates/redoc.html
---

<redoc spec-url='{{base_path}}/reference/product-apis/admin-apis/admin-v4/admin-v4.yaml'></redoc>
<redoc spec-url='{{base_path}}/reference/product-apis/admin-apis/admin-v5/admin-v5.yaml'></redoc>
<script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
Loading