From 204224853484ba357547049deba6e922a3071724 Mon Sep 17 00:00:00 2001 From: Tharindu Dharmarathna Date: Thu, 15 Apr 2021 12:44:44 +0530 Subject: [PATCH 1/2] modify test cases to remove endpointSecurityDTO --- .../publisher-api.yaml.sha256 | 2 +- .../clients/publisher/api/openapi.yaml | 2281 +++++------------ .../clients/publisher/docs/APIDTO.md | 4 +- .../clients/publisher/docs/APIInfoDTO.md | 3 +- .../clients/publisher/docs/APIRevisionDTO.md | 8 +- .../docs/APIRevisionDeploymentDTO.md | 2 +- .../publisher/docs/AdvertiseInfoDTO.md | 14 + .../clients/publisher/docs/ApIsApi.md | 16 +- .../publisher/docs/ApiProductRevisionsApi.md | 109 +- .../clients/publisher/docs/ApiRevisionsApi.md | 121 +- ...ISpecificationValidationResponseInfoDTO.md | 1 + .../clients/publisher/docs/CommentDTO.md | 6 +- .../clients/publisher/docs/CommentListDTO.md | 4 +- .../clients/publisher/docs/CommentsApi.md | 15 +- .../docs/DocumentSearchResultAllOfDTO.md | 1 + .../publisher/docs/DocumentSearchResultDTO.md | 1 + .../clients/publisher/docs/EnvironmentDTO.md | 1 - .../clients/publisher/docs/GraphQLQueryDTO.md | 13 + .../clients/publisher/docs/SettingsDTO.md | 1 - .../publisher/docs/ThrottlePolicyDTO.md | 17 + .../clients/publisher/docs/ValidationApi.md | 10 +- .../WebsubSubscriptionConfigurationDTO.md | 1 + .../clients/publisher/api/ApiCallback.java | 2 +- .../clients/publisher/api/ApiClient.java | 2 +- .../clients/publisher/api/ApiException.java | 2 +- .../clients/publisher/api/ApiResponse.java | 2 +- .../clients/publisher/api/Configuration.java | 2 +- .../publisher/api/GzipRequestInterceptor.java | 2 +- .../clients/publisher/api/JSON.java | 11 +- .../clients/publisher/api/Pair.java | 2 +- .../publisher/api/ProgressRequestBody.java | 2 +- .../publisher/api/ProgressResponseBody.java | 2 +- .../clients/publisher/api/StringUtil.java | 2 +- .../publisher/api/auth/ApiKeyAuth.java | 2 +- .../publisher/api/auth/Authentication.java | 2 +- .../publisher/api/auth/HttpBasicAuth.java | 2 +- .../publisher/api/auth/HttpBearerAuth.java | 2 +- .../clients/publisher/api/auth/OAuth.java | 2 +- .../clients/publisher/api/auth/OAuthFlow.java | 2 +- .../api/v1/AlertConfigurationApi.java | 441 ---- .../api/v1/AlertSubscriptionsApi.java | 383 --- .../clients/publisher/api/v1/AlertsApi.java | 163 -- .../clients/publisher/api/v1/ApIsApi.java | 42 +- .../clients/publisher/api/v1/ApiAuditApi.java | 2 +- .../api/v1/ApiCategoryCollectionApi.java | 2 +- .../publisher/api/v1/ApiDocumentsApi.java | 2 +- .../publisher/api/v1/ApiLifecycleApi.java | 2 +- .../api/v1/ApiMediationPoliciesApi.java | 2 +- .../api/v1/ApiMediationPolicyApi.java | 2 +- .../publisher/api/v1/ApiMonetizationApi.java | 2 +- .../api/v1/ApiProductDocumentsApi.java | 2 +- .../api/v1/ApiProductRevisionsApi.java | 201 +- .../publisher/api/v1/ApiProductsApi.java | 2 +- .../api/v1/ApiResourcePoliciesApi.java | 2 +- .../publisher/api/v1/ApiRevisionsApi.java | 231 +- .../api/v1/AwsLambdaIndividualApi.java | 2 +- .../api/v1/ClientCertificatesApi.java | 2 +- .../clients/publisher/api/v1/CommentsApi.java | 62 +- .../publisher/api/v1/DeploymentStatusApi.java | 181 -- .../publisher/api/v1/DeploymentsApi.java | 171 -- .../api/v1/EndpointCertificatesApi.java | 2 +- .../publisher/api/v1/ExternalStoresApi.java | 2 +- .../api/v1/GlobalMediationPoliciesApi.java | 2 +- .../api/v1/GlobalMediationPolicyApi.java | 2 +- .../publisher/api/v1/GraphQlPoliciesApi.java | 2 +- .../publisher/api/v1/GraphQlSchemaApi.java | 2 +- .../api/v1/GraphQlSchemaIndividualApi.java | 2 +- .../publisher/api/v1/ImportExportApi.java | 2 +- .../api/v1/KeyManagersCollectionApi.java | 2 +- .../publisher/api/v1/LabelCollectionApi.java | 158 -- .../clients/publisher/api/v1/RolesApi.java | 2 +- .../clients/publisher/api/v1/ScopesApi.java | 2 +- .../clients/publisher/api/v1/SettingsApi.java | 2 +- .../publisher/api/v1/SubscriberApi.java | 2 +- .../publisher/api/v1/SubscriptionsApi.java | 2 +- .../clients/publisher/api/v1/TenantsApi.java | 2 +- .../api/v1/ThrottlingPoliciesApi.java | 2 +- .../publisher/api/v1/UnifiedSearchApi.java | 2 +- .../publisher/api/v1/ValidationApi.java | 34 +- .../v1/dto/APIAdditionalPropertiesDTO.java | 2 +- .../api/v1/dto/APIBusinessInformationDTO.java | 2 +- .../publisher/api/v1/dto/APICategoryDTO.java | 2 +- .../api/v1/dto/APICategoryListDTO.java | 2 +- .../api/v1/dto/APICorsConfigurationDTO.java | 2 +- .../clients/publisher/api/v1/dto/APIDTO.java | 127 +- .../api/v1/dto/APIEndpointSecurityDTO.java | 204 -- .../api/v1/dto/APIExternalStoreDTO.java | 2 +- .../api/v1/dto/APIExternalStoreListDTO.java | 2 +- .../publisher/api/v1/dto/APIInfoDTO.java | 62 +- ...nfoWebsubSubscriptionConfigurationDTO.java | 157 -- .../publisher/api/v1/dto/APIKeyDTO.java | 2 +- .../publisher/api/v1/dto/APIListDTO.java | 2 +- .../api/v1/dto/APIListExpandedDTO.java | 2 +- .../publisher/api/v1/dto/APIMaxTpsDTO.java | 2 +- .../api/v1/dto/APIMonetizationInfoDTO.java | 2 +- .../api/v1/dto/APIMonetizationUsageDTO.java | 2 +- .../api/v1/dto/APIOperationsDTO.java | 2 +- .../dto/APIProductBusinessInformationDTO.java | 2 +- .../publisher/api/v1/dto/APIProductDTO.java | 2 +- .../api/v1/dto/APIProductInfoDTO.java | 2 +- .../api/v1/dto/APIProductListDTO.java | 2 +- .../v1/dto/APIProductOutdatedStatusDTO.java | 2 +- .../dto/APIProductSearchResultAllOfDTO.java | 2 +- .../api/v1/dto/APIProductSearchResultDTO.java | 2 +- .../publisher/api/v1/dto/APIRevenueDTO.java | 2 +- .../api/v1/dto/APIRevisionAPIInfoDTO.java | 2 +- .../publisher/api/v1/dto/APIRevisionDTO.java | 11 +- .../api/v1/dto/APIRevisionDeploymentDTO.java | 11 +- .../v1/dto/APIRevisionDeploymentListDTO.java | 2 +- .../api/v1/dto/APIRevisionListDTO.java | 2 +- .../publisher/api/v1/dto/APIScopeDTO.java | 2 +- .../api/v1/dto/APISearchResultAllOfDTO.java | 2 +- .../api/v1/dto/APISearchResultDTO.java | 2 +- .../api/v1/dto/APIServiceInfoDTO.java | 2 +- .../dto/APIThreatProtectionPoliciesDTO.java | 2 +- .../APIThreatProtectionPoliciesListDTO.java | 2 +- .../api/v1/dto/AdvertiseInfoDTO.java | 157 ++ .../publisher/api/v1/dto/AlertConfigDTO.java | 131 - .../api/v1/dto/AlertConfigListDTO.java | 131 - .../publisher/api/v1/dto/AlertDTO.java | 160 -- .../publisher/api/v1/dto/AlertTypeDTO.java | 157 -- .../api/v1/dto/AlertTypesListDTO.java | 131 - .../publisher/api/v1/dto/AlertsInfoDTO.java | 131 - .../api/v1/dto/AlertsInfoResponseDTO.java | 161 -- .../dto/ApiEndpointValidationResponseDTO.java | 2 +- .../publisher/api/v1/dto/ApplicationDTO.java | 2 +- .../api/v1/dto/ApplicationInfoDTO.java | 2 +- ...APISpecificationValidationResponseDTO.java | 2 +- ...pecificationValidationResponseInfoDTO.java | 33 +- .../publisher/api/v1/dto/AuditReportDTO.java | 2 +- .../api/v1/dto/BandwidthLimitAllOfDTO.java | 2 +- .../api/v1/dto/BandwidthLimitDTO.java | 2 +- .../publisher/api/v1/dto/CertMetadataDTO.java | 2 +- .../api/v1/dto/CertificateInfoDTO.java | 2 +- .../api/v1/dto/CertificateValidityDTO.java | 2 +- .../publisher/api/v1/dto/CertificatesDTO.java | 2 +- .../publisher/api/v1/dto/ClaimDTO.java | 2 +- .../api/v1/dto/ClientCertMetadataDTO.java | 2 +- .../api/v1/dto/ClientCertificatesDTO.java | 2 +- .../publisher/api/v1/dto/CommentDTO.java | 4 +- .../publisher/api/v1/dto/CommentListDTO.java | 2 +- .../api/v1/dto/CommenterInfoDTO.java | 2 +- .../api/v1/dto/CustomAttributeDTO.java | 2 +- .../api/v1/dto/DeploymentClusterInfoDTO.java | 185 -- .../v1/dto/DeploymentClusterStatusDTO.java | 157 -- .../api/v1/dto/DeploymentEnvironmentsDTO.java | 128 - .../api/v1/dto/DeploymentListDTO.java | 131 - .../api/v1/dto/DeploymentStatusDTO.java | 129 - .../api/v1/dto/DeploymentStatusListDTO.java | 131 - .../publisher/api/v1/dto/DeploymentsDTO.java | 129 - .../publisher/api/v1/dto/DocumentDTO.java | 2 +- .../publisher/api/v1/dto/DocumentListDTO.java | 2 +- .../v1/dto/DocumentSearchResultAllOfDTO.java | 6 +- .../api/v1/dto/DocumentSearchResultDTO.java | 6 +- .../v1/dto/EndpointConfigAttributesDTO.java | 2 +- .../api/v1/dto/EndpointConfigDTO.java | 2 +- .../publisher/api/v1/dto/EndpointDTO.java | 2 +- .../api/v1/dto/EndpointEndpointConfigDTO.java | 2 +- .../v1/dto/EndpointEndpointSecurityDTO.java | 2 +- .../publisher/api/v1/dto/EndpointListDTO.java | 2 +- .../publisher/api/v1/dto/EnvironmentDTO.java | 33 +- .../api/v1/dto/EnvironmentEndpointsDTO.java | 186 -- .../api/v1/dto/EnvironmentListDTO.java | 2 +- .../publisher/api/v1/dto/ErrorDTO.java | 2 +- .../api/v1/dto/ErrorListItemDTO.java | 2 +- .../api/v1/dto/EventCountLimitAllOfDTO.java | 2 +- .../api/v1/dto/EventCountLimitDTO.java | 2 +- .../api/v1/dto/ExternalStoreDTO.java | 2 +- .../api/v1/dto/ExternalStoreListDTO.java | 2 +- .../publisher/api/v1/dto/FileInfoDTO.java | 2 +- .../dto/GraphQLCustomComplexityInfoDTO.java | 2 +- .../v1/dto/GraphQLQueryComplexityInfoDTO.java | 2 +- .../publisher/api/v1/dto/GraphQLQueryDTO.java | 128 + .../api/v1/dto/GraphQLSchemaDTO.java | 2 +- .../api/v1/dto/GraphQLSchemaTypeDTO.java | 2 +- .../api/v1/dto/GraphQLSchemaTypeListDTO.java | 2 +- .../v1/dto/GraphQLValidationResponseDTO.java | 2 +- ...aphQLValidationResponseGraphQLInfoDTO.java | 2 +- .../api/v1/dto/KeyManagerInfoDTO.java | 2 +- .../api/v1/dto/KeyManagerListDTO.java | 2 +- .../publisher/api/v1/dto/LabelDTO.java | 158 -- .../publisher/api/v1/dto/LabelListDTO.java | 161 -- .../api/v1/dto/LifecycleHistoryDTO.java | 2 +- .../api/v1/dto/LifecycleHistoryItemDTO.java | 2 +- ...LifecycleStateAvailableTransitionsDTO.java | 2 +- .../v1/dto/LifecycleStateCheckItemsDTO.java | 2 +- .../api/v1/dto/LifecycleStateDTO.java | 2 +- .../publisher/api/v1/dto/MediationDTO.java | 2 +- .../api/v1/dto/MediationInfoDTO.java | 2 +- .../api/v1/dto/MediationListDTO.java | 2 +- .../api/v1/dto/MediationPolicyDTO.java | 2 +- .../v1/dto/MockResponsePayloadInfoDTO.java | 2 +- .../v1/dto/MockResponsePayloadListDTO.java | 2 +- .../api/v1/dto/MonetizationAttributeDTO.java | 2 +- .../api/v1/dto/MonetizationInfoDTO.java | 2 +- ...penAPIDefinitionValidationResponseDTO.java | 2 +- ...PIDefinitionValidationResponseInfoDTO.java | 2 +- .../publisher/api/v1/dto/PaginationDTO.java | 2 +- .../api/v1/dto/PatchRequestBodyDTO.java | 2 +- .../publisher/api/v1/dto/PodStatusDTO.java | 183 -- .../api/v1/dto/PostRequestBodyDTO.java | 2 +- .../publisher/api/v1/dto/ProductAPIDTO.java | 2 +- .../api/v1/dto/RequestCountLimitAllOfDTO.java | 2 +- .../api/v1/dto/RequestCountLimitDTO.java | 2 +- .../publisher/api/v1/dto/ResourcePathDTO.java | 2 +- .../api/v1/dto/ResourcePathListDTO.java | 2 +- .../api/v1/dto/ResourcePolicyInfoDTO.java | 2 +- .../api/v1/dto/ResourcePolicyListDTO.java | 2 +- .../publisher/api/v1/dto/ScopeDTO.java | 2 +- .../publisher/api/v1/dto/ScopeListDTO.java | 2 +- .../publisher/api/v1/dto/SearchResultDTO.java | 2 +- .../api/v1/dto/SearchResultListDTO.java | 2 +- .../api/v1/dto/SecurityAuditAttributeDTO.java | 2 +- .../publisher/api/v1/dto/SettingsDTO.java | 36 +- .../api/v1/dto/SharedScopeUsageDTO.java | 2 +- .../api/v1/dto/SharedScopeUsedAPIInfoDTO.java | 2 +- .../SharedScopeUsedAPIResourceInfoDTO.java | 2 +- .../api/v1/dto/SubscriberInfoDTO.java | 2 +- .../publisher/api/v1/dto/SubscriptionDTO.java | 2 +- .../api/v1/dto/SubscriptionListDTO.java | 2 +- .../v1/dto/SubscriptionPolicyAllOfDTO.java | 2 +- .../api/v1/dto/SubscriptionPolicyDTO.java | 2 +- .../api/v1/dto/SubscriptionPolicyListDTO.java | 2 +- ...bscriptionThrottlePolicyPermissionDTO.java | 2 +- .../publisher/api/v1/dto/TenantDTO.java | 2 +- .../publisher/api/v1/dto/TenantListDTO.java | 2 +- .../api/v1/dto/ThreatProtectionPolicyDTO.java | 2 +- .../v1/dto/ThreatProtectionPolicyListDTO.java | 2 +- .../api/v1/dto/ThrottleLimitBaseDTO.java | 2 +- .../api/v1/dto/ThrottleLimitDTO.java | 2 +- .../api/v1/dto/ThrottlePolicyDTO.java | 247 ++ .../api/v1/dto/ThrottlingPolicyDTO.java | 2 +- .../api/v1/dto/ThrottlingPolicyListDTO.java | 2 +- .../publisher/api/v1/dto/TopicDTO.java | 2 +- .../publisher/api/v1/dto/TopicListDTO.java | 2 +- .../publisher/api/v1/dto/VHostDTO.java | 2 +- .../publisher/api/v1/dto/WSDLInfoDTO.java | 2 +- .../api/v1/dto/WSDLValidationResponseDTO.java | 2 +- .../WSDLValidationResponseWsdlInfoDTO.java | 2 +- ...alidationResponseWsdlInfoEndpointsDTO.java | 2 +- .../WebsubSubscriptionConfigurationDTO.java | 35 +- .../api/v1/dto/WorkflowResponseDTO.java | 2 +- .../src/main/resources/publisher-api.yaml | 1243 +++------ .../test/impl/RestAPIPublisherImpl.java | 19 +- .../ChangeEndPointSecurityOfAPITestCase.java | 3 +- ...ChangeEndPointSecurityPerTypeTestCase.java | 3 +- ...g.wso2.am.thirdparty.km-4.0.0-SNAPSHOT.jar | Bin 0 -> 32090 bytes .../modules/addressing-1.6.1-wso2v63.mar | Bin 0 -> 31668 bytes 248 files changed, 2702 insertions(+), 7560 deletions(-) create mode 100644 modules/integration/tests-common/clients/publisher/docs/AdvertiseInfoDTO.md create mode 100644 modules/integration/tests-common/clients/publisher/docs/GraphQLQueryDTO.md create mode 100644 modules/integration/tests-common/clients/publisher/docs/ThrottlePolicyDTO.md delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertConfigurationApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertSubscriptionsApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertsApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentStatusApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentsApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/LabelCollectionApi.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIEndpointSecurityDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoWebsubSubscriptionConfigurationDTO.java create mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AdvertiseInfoDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigListDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypeDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypesListDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoResponseDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterInfoDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterStatusDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentEnvironmentsDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentListDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusListDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentsDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentEndpointsDTO.java create mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelListDTO.java delete mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PodStatusDTO.java create mode 100644 modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlePolicyDTO.java create mode 100644 modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/configFiles/idpjwt/org.wso2.am.thirdparty.km-4.0.0-SNAPSHOT.jar create mode 100644 modules/integration/tests-integration/tests-backend/src/test/resources/client/modules/addressing-1.6.1-wso2v63.mar diff --git a/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 b/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 index e7baf8e4ea..a3e137fb0d 100644 --- a/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 +++ b/modules/integration/tests-common/clients/publisher/.openapi-generator/publisher-api.yaml.sha256 @@ -1 +1 @@ -aeac79f59eac2ab16468e051b6367e63ed9c1b0cb9bee08e25d6f22bb2579c91 \ No newline at end of file +629d75bf7ecb7ed51ea5e89462cb418c6ed19cc46f40fe4bc207f534bca4bba2 \ No newline at end of file diff --git a/modules/integration/tests-common/clients/publisher/api/openapi.yaml b/modules/integration/tests-common/clients/publisher/api/openapi.yaml index bb993dcb39..5b463a40f3 100644 --- a/modules/integration/tests-common/clients/publisher/api/openapi.yaml +++ b/modules/integration/tests-common/clients/publisher/api/openapi.yaml @@ -8,7 +8,7 @@ info: This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication - Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking + The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types @@ -56,11 +56,11 @@ info: ``` curl -k -d "grant_type=password&username=&password=" \ -H "Authorization: Basic base64(cliet_id:client_secret)" - \ https://:/token + \ https://:/oauth2/token ``` **Sample request** ``` - curl https://localhost:8243/token -k \ + curl https://localhost:9443/oauth2/token -k \ -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \ -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create" ``` @@ -143,14 +143,13 @@ paths: "provider:wso2" will match an API if the provider of the API contains "wso2". "provider:"wso2"" will match an API if the provider of the API is exactly "wso2". "status:PUBLISHED" will match an API if the API is in PUBLISHED state. - "label:external" will match an API if it contains a Microgateway label called "external". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, - description, subcontext, doc, provider, label**] + description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. @@ -833,9 +832,16 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_create summary: Update the Service that is used to create the API tags: - APIs + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/ecb5b300-422d-4ee8-88d2-364a0a122238/reimport-service"' x-accepts: application/json /apis/{apiId}/swagger: get: @@ -2514,15 +2520,16 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export - summary: List available revisions of an API + summary: List Revisions tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' x-accepts: application/json post: description: | @@ -2581,15 +2588,16 @@ paths: one of the preconditions is not met. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export - summary: Create a new API revision + summary: Create API Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' x-contentType: application/json x-accepts: application/json /apis/{apiId}/revisions/{revisionId}: @@ -2643,15 +2651,16 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export - summary: Delete a revision of an API + summary: Delete Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' x-accepts: application/json get: description: | @@ -2699,16 +2708,17 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Retrieve a revision of an API + summary: Retrieve Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' x-accepts: application/json - /apis/{apiId}/deploy-revision: + /apis/{apiId}/deployments: get: description: | List available deployed revision deployment details of an API @@ -2746,15 +2756,81 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: List available deployed revision deployment details of an API + summary: List Deployments tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments"' + x-accepts: application/json + /apis/{apiId}/deployments/{deploymentId}: + put: + description: | + Update deployment devportal visibility + operationId: updateAPIDeployment + parameters: + - description: | + **API ID** consisting of the **UUID** of the API. + explode: false + in: path + name: apiId + required: true + schema: + type: string + style: simple + - description: | + Base64 URL encoded value of the name of an environment + explode: false + in: path + name: deploymentId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + description: Deployment object that needs to be updated + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + description: | + Created. + Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + summary: Update Deployment + tags: + - API Revisions + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments/UHJvZHVjdGlvbiBhbmQgU2FuZGJveA"' + x-contentType: application/json x-accepts: application/json + /apis/{apiId}/deploy-revision: post: description: | Deploy a revision @@ -2788,9 +2864,6 @@ paths: description: Deployment object that needs to be added responses: "200": - description: | - OK. - "201": content: application/json: schema: @@ -2800,6 +2873,18 @@ paths: description: | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. "404": content: application/json: @@ -2814,20 +2899,21 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Deploy a revision + summary: Deploy Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' x-contentType: application/json x-accepts: application/json /apis/{apiId}/undeploy-revision: post: description: | - Un-Deploy a revision + UnDeploy a revision operationId: undeployAPIRevision parameters: - description: | @@ -2887,6 +2973,18 @@ paths: description: | Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. "404": content: application/json: @@ -2901,21 +2999,22 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export - summary: Un-Deploy a revision + summary: UnDeploy Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' x-contentType: application/json x-accepts: application/json /apis/{apiId}/restore-revision: post: description: | - Restore a revision to the working copy of the API + Restore a revision to the current API of the API operationId: restoreAPIRevision parameters: - description: | @@ -2959,14 +3058,15 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Restore a revision + summary: Restore API Revision tags: - API Revisions x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' x-accepts: application/json /apis/import-service: post: @@ -2975,6 +3075,7 @@ paths: operationId: importServiceFromCatalog parameters: - description: ID of service that should be imported from Service Catalog + example: Pizzashack-1.0.0 explode: true in: query name: serviceKey @@ -3037,9 +3138,16 @@ paths: schema: $ref: '#/components/schemas/Error' description: Internal Server Error. + security: + - OAuth2Security: + - apim:api_create summary: Import a Service from Service Catalog tags: - APIs + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-service?serviceKey=Pizzashack-1.0.0"' x-contentType: application/json x-accepts: application/json /apis/{apiId}/comments: @@ -3106,30 +3214,31 @@ paths: description: | OK. Comments list is returned. - "401": + "404": content: application/json: example: - code: 401 - message: Unauthorized - description: The user is not authorized + code: 404 + message: Not Found + description: The specified resource does not exist moreInfo: "" error: [] schema: $ref: '#/components/schemas/Error' - description: Unauthorized. The user is not authorized. - "406": + description: Not Found. The specified resource does not exist. + "500": content: application/json: example: - code: 406 - message: Not Acceptable - description: The requested media type is not supported + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. moreInfo: "" error: [] schema: $ref: '#/components/schemas/Error' - description: Not Acceptable. The requested media type is not supported. + description: Internal Server Error. security: - OAuth2Security: - apim:comment_view @@ -3171,6 +3280,7 @@ paths: description: | Content of the comment example: This is a comment + maxLength: 512 type: string category: description: | @@ -3233,6 +3343,18 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unauthorized. The user is not authorized. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. "415": content: application/json: @@ -3246,6 +3368,19 @@ paths: $ref: '#/components/schemas/Error' description: Unsupported Media Type. The entity of the request was not in a supported format. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. security: - OAuth2Security: - apim:comment_write @@ -3309,6 +3444,20 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unauthorized. The user is not authorized. + "403": + content: + application/json: + example: + code: 403 + message: Forbidden + description: The request must be conditional but no condition has + been specified + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Forbidden. The request must be conditional but no condition + has been specified. "404": content: application/json: @@ -3321,6 +3470,24 @@ paths: schema: $ref: '#/components/schemas/Error' description: Not Found. The specified resource does not exist. + "405": + content: {} + description: | + MethodNotAllowed. + Request method is known by the server but is not supported by the target resource. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. security: - OAuth2Security: - apim:comment_write @@ -3432,11 +3599,6 @@ paths: schema: type: string style: simple - "304": - content: {} - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. "401": content: application/json: @@ -3473,6 +3635,19 @@ paths: schema: $ref: '#/components/schemas/Error' description: Not Acceptable. The requested media type is not supported. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. security: - OAuth2Security: - apim:comment_view @@ -3516,6 +3691,7 @@ paths: description: | Content of the comment example: This is a comment + maxLength: 512 type: string category: description: | @@ -3575,6 +3751,20 @@ paths: schema: $ref: '#/components/schemas/Error' description: Unauthorized. The user is not authorized. + "403": + content: + application/json: + example: + code: 403 + message: Forbidden + description: The request must be conditional but no condition has + been specified + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Forbidden. The request must be conditional but no condition + has been specified. "404": content: application/json: @@ -3600,6 +3790,19 @@ paths: $ref: '#/components/schemas/Error' description: Unsupported Media Type. The entity of the request was not in a supported format. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. security: - OAuth2Security: - apim:comment_write @@ -3608,7 +3811,7 @@ paths: - Comments x-code-samples: - lang: Curl - source: 'curl -k -X PUT -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + source: 'curl -k -X PATCH -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"' x-contentType: application/json x-accepts: application/json @@ -3712,11 +3915,6 @@ paths: schema: type: string style: simple - "304": - content: {} - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. "401": content: application/json: @@ -3753,6 +3951,19 @@ paths: schema: $ref: '#/components/schemas/Error' description: Not Acceptable. The requested media type is not supported. + "500": + content: + application/json: + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Internal Server Error. security: - OAuth2Security: - apim:comment_view @@ -3761,7 +3972,7 @@ paths: - Comments x-code-samples: - lang: Curl - source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" + source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4/replies" x-accepts: application/json /apis/import-openapi: post: @@ -3787,6 +3998,9 @@ paths: description: Additional attributes specified as a stringified JSON with API's schema type: string + inlineAPIDefinition: + description: Inline content of the OpenAPI definition + type: string responses: "201": content: @@ -4068,7 +4282,7 @@ paths: security: - OAuth2Security: - apim:api_create - summary: Import API Definition + summary: Import a GraphQL SDL tags: - APIs x-code-samples: @@ -4107,6 +4321,9 @@ paths: description: OpenAPI definition as a file format: binary type: string + inlineAPIDefinition: + description: Inline content of the OpenAPI definition + type: string responses: "200": content: @@ -4455,7 +4672,7 @@ paths: security: - OAuth2Security: - apim:api_create - summary: Validate GraphQL API Definition and Retrieve a Summary + summary: Validate a GraphQL SDL tags: - Validation x-code-samples: @@ -7671,6 +7888,7 @@ paths: security: - OAuth2Security: - apim:api_import_export + - apim:admin summary: Import an API tags: - Import Export @@ -8220,33 +8438,32 @@ paths: source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api"' x-accepts: application/json - /throttling-policies/{policyLevel}/{policyName}: + /throttling-policies/streaming/subscription: get: description: | - This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. - operationId: getThrottlingPolicyByName + This operation can be used to list the available streaming subscription policies + operationId: getSubscriptionThrottlingPolicies parameters: - description: | - Tier name - explode: false - in: path - name: policyName - required: true + Maximum size of resource array to return. + explode: true + in: query + name: limit + required: false schema: - type: string - style: simple + default: 25 + type: integer + style: form - description: | - List API or Application or Resource type policies. - explode: false - in: path - name: policyLevel - required: true + Starting point within the complete list of items qualified. + explode: true + in: query + name: offset + required: false schema: - enum: - - api - - subcription - type: string - style: simple + default: 0 + type: integer + style: form - description: | Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. @@ -8262,10 +8479,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ThrottlingPolicy' + $ref: '#/components/schemas/SubscriptionPolicyList' description: | OK. - Tier returned + List of subscription policies returned. headers: ETag: description: | @@ -8275,17 +8492,8 @@ paths: schema: type: string style: simple - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - explode: false - schema: - type: string - style: simple Content-Type: - description: | - The content type of the body. + description: The content type of the body. explode: false schema: type: string @@ -8295,18 +8503,6 @@ paths: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - "404": - content: - application/json: - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Not Found. The specified resource does not exist. "406": content: application/json: @@ -8322,40 +8518,41 @@ paths: security: - OAuth2Security: - apim:api_view - summary: Get Details of a Policy + summary: Get streaming throttling policies tags: - Throttling Policies x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/subscription?tierQuotaType=RequestCountLimit"' x-accepts: application/json - /throttling-policies/streaming/subscription: + /throttling-policies/{policyLevel}/{policyName}: get: description: | - This operation can be used to list the available streaming subscription policies - operationId: getSubscriptionThrottlingPolicies + This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. + operationId: getThrottlingPolicyByName parameters: - description: | - Maximum size of resource array to return. - explode: true - in: query - name: limit - required: false + Tier name + explode: false + in: path + name: policyName + required: true schema: - default: 25 - type: integer - style: form + type: string + style: simple - description: | - Starting point within the complete list of items qualified. - explode: true - in: query - name: offset - required: false + List API or Application or Resource type policies. + explode: false + in: path + name: policyLevel + required: true schema: - default: 0 - type: integer - style: form + enum: + - api + - subcription + type: string + style: simple - description: | Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. @@ -8371,10 +8568,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/SubscriptionPolicyList' + $ref: '#/components/schemas/ThrottlingPolicy' description: | OK. - List of subscription policies returned. + Tier returned headers: ETag: description: | @@ -8384,8 +8581,17 @@ paths: schema: type: string style: simple + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + explode: false + schema: + type: string + style: simple Content-Type: - description: The content type of the body. + description: | + The content type of the body. explode: false schema: type: string @@ -8395,6 +8601,18 @@ paths: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. "406": content: application/json: @@ -8410,13 +8628,13 @@ paths: security: - OAuth2Security: - apim:api_view - summary: Get streaming throttling policies + summary: Get Details of a Policy tags: - Throttling Policies x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/streaming/subscription"' + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' x-accepts: application/json /mediation-policies: get: @@ -11626,9 +11844,10 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_product_import_export - summary: List available revisions of an API Product + summary: List Revisions tags: - API Product Revisions x-code-samples: @@ -11695,6 +11914,7 @@ paths: one of the preconditions is not met. security: - OAuth2Security: + - apim:api_create - apim:api_publish summary: Create a new API Product revision tags: @@ -11758,8 +11978,9 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Delete a revision of an API Product + summary: Delete Revision tags: - API Product Revisions x-code-samples: @@ -11815,8 +12036,9 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Retrieve a revision of an API Product + summary: Retrieve Revision tags: - API Product Revisions x-code-samples: @@ -11824,7 +12046,7 @@ paths: source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' x-accepts: application/json - /api-products/{apiProductId}/deploy-revision: + /api-products/{apiProductId}/deployments: get: description: | List available deployed revision deployment details of an API Product @@ -11864,18 +12086,86 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: List available deployed revision deployment details of an API Product + summary: List Deployments tags: - API Product Revisions x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments"' + x-accepts: application/json + /api-products/{apiProductId}/deployments/{deploymentId}: + put: + description: | + Update deployment devportal visibility + operationId: updateAPIProductDeployment + parameters: + - description: | + **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. + explode: false + in: path + name: apiProductId + required: true + schema: + type: string + x-encoded: true + style: simple + x-encoded: true + - description: | + Base64 URL encoded value of the name of an environment + explode: false + in: path + name: deploymentId + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + description: Deployment object that needs to be updated + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + description: | + Created. + Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. + "404": + content: + application/json: + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Not Found. The specified resource does not exist. + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + summary: Update Deployment + tags: + - API Product Revisions + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments/UHJvZHVjdGlvbiBhbmQgU2FuZGJveA"' + x-contentType: application/json x-accepts: application/json + /api-products/{apiProductId}/deploy-revision: post: description: | - Deploy a revision + Deploy an API Product Revision operationId: deployAPIProductRevision parameters: - description: | @@ -11920,6 +12210,18 @@ paths: description: | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. "404": content: application/json: @@ -11934,8 +12236,9 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Deploy a revision + summary: Deploy Revision tags: - API Product Revisions x-code-samples: @@ -11947,7 +12250,7 @@ paths: /api-products/{apiProductId}/undeploy-revision: post: description: | - Un-Deploy a revision + UnDeploy an API Product Revision operationId: undeployAPIProductRevision parameters: - description: | @@ -12009,6 +12312,18 @@ paths: description: | Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. + "400": + content: + application/json: + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + schema: + $ref: '#/components/schemas/Error' + description: Bad Request. Invalid request or validation error. "404": content: application/json: @@ -12023,9 +12338,10 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_product_import_export - summary: Un-Deploy a revision + summary: UnDeploy Revision tags: - API Product Revisions x-code-samples: @@ -12037,7 +12353,7 @@ paths: /api-products/{apiProductId}/restore-revision: post: description: | - Restore a revision to the working copy of the API Product + Restore a revision to the Current API of the API Product operationId: restoreAPIProductRevision parameters: - description: | @@ -12083,8 +12399,9 @@ paths: description: Not Found. The specified resource does not exist. security: - OAuth2Security: + - apim:api_create - apim:api_publish - summary: Restore a revision + summary: Restore Revision tags: - API Product Revisions x-code-samples: @@ -12654,484 +12971,33 @@ paths: x-examples: $ref: docs/examples/tenants/tenants.yaml x-accepts: application/json - /alert-types: + /api-categories: get: description: | - This operation is used to get the list of supportd alert types for the 'publisher' agent. - operationId: getPublisherAlertTypes + Get all API categories + operationId: getAllAPICategories responses: "200": content: application/json: schema: - $ref: '#/components/schemas/AlertTypesList' + $ref: '#/components/schemas/APICategoryList' description: | OK. - The list of publisher alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. + Categories returned security: - OAuth2Security: - - apim:pub_alert_manage - summary: | - Get the list of API Publisher alert types. + - apim:api_view + summary: Get all API categories tags: - - Alerts + - API Category (Collection) x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-types"' - x-examples: - $ref: docs/examples/alerts/alerts.yaml#/get + "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' x-accepts: application/json - /alert-subscriptions: - delete: - description: | - This operation is used to unsubscribe the respective user from all the alert types. - operationId: unsubscribeAllAlerts - responses: - "200": - content: {} - description: | - OK. - The user is unsubscribed from the alerts successfully. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Unsubscribe User from All the Alert Types - tags: - - Alert Subscriptions - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/delete - x-accepts: application/json - get: - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: getSubscribedAlertTypes - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - description: | - OK. - The list of subscribed alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Get the List of API Publisher Alert Types Subscribed by the User - tags: - - Alert Subscriptions - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/get - x-accepts: application/json - put: - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: subscribeToAlerts - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - description: The alerts list and the email list to subscribe. - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfoResponse' - description: | - OK. - Successful response with the newly subscribed alerts. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "400": - content: - application/json: - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Bad Request. Invalid request or validation error. - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Subscribe to the Selected Tlert types by the User - tags: - - Alert Subscriptions - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/put - x-contentType: application/json - x-accepts: application/json - /alerts/{alertType}/configurations: - get: - description: | - This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - operationId: getAllAlertConfigs - parameters: - - description: The alert type. - explode: false - in: path - name: alertType - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigList' - description: | - OK. - The Developer Portal alert configuration. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Get All AbnormalRequestsPerMin Alert Configurations - tags: - - Alert Configuration - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alerts/{alertType}/configurations"' - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/get - x-accepts: application/json - /alerts/{alertType}/configurations/{configurationId}: - delete: - description: | - This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - operationId: deleteAlertConfig - parameters: - - description: The alert type. - explode: false - in: path - name: alertType - required: true - schema: - type: string - style: simple - - description: The alert configuration id. - explode: false - in: path - name: configurationId - required: true - schema: - type: string - style: simple - responses: - "200": - content: {} - description: | - OK. - The alert config is deleted successfully. - "400": - content: - application/json: - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Bad Request. Invalid request or validation error. - "404": - content: - application/json: - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Not Found. The specified resource does not exist. - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - tags: - - Alert Configuration - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/delete - x-accepts: application/json - put: - description: | - This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - operationId: addAlertConfig - parameters: - - description: The alert type. - explode: false - in: path - name: alertType - required: true - schema: - type: string - style: simple - - description: The alert configuration id. - explode: false - in: path - name: configurationId - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigInfo' - description: Configuration for AbnormalRequestCount alert type - required: true - responses: - "201": - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfig' - description: | - Created. - Successful response with newly created object as entity. - Location header contains URL of newly created entity. - headers: - Location: - description: | - The location of the newly created entity. - explode: false - schema: - type: string - style: simple - "400": - content: - application/json: - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Bad Request. Invalid request or validation error. - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:pub_alert_manage - summary: | - Add AbnormalRequestsPerMin Alert Configurations. - tags: - - Alert Configuration - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/put - x-contentType: application/json - x-accepts: application/json - /labels: - get: - description: | - Get all registered Labels - operationId: getLabels - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/LabelList' - description: | - OK. - Labels returned - security: - - OAuth2Security: - - apim:api_view - summary: Get all Registered Labels - tags: - - Label Collection - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/labels"' - x-accepts: application/json - /api-categories: - get: - description: | - Get all API categories - operationId: getAllAPICategories - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/APICategoryList' - description: | - OK. - Categories returned - security: - - OAuth2Security: - - apim:api_view - summary: Get all API categories - tags: - - API Category (Collection) - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' - x-accepts: application/json - /scopes: - get: + /scopes: + get: description: | This operation can be used to get all the available Shared Scopes. operationId: getSharedScopes @@ -13467,179 +13333,26 @@ paths: security: - OAuth2Security: - apim:shared_scope_manage - summary: Update a Shared Scope - tags: - - Scopes - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' - x-contentType: application/json - x-accepts: application/json - /scopes/{scopeId}/usage: - get: - description: | - This operation can be used to retrieve usages of a Shared Scope by a given scope Id. - operationId: getSharedScopeUsages - parameters: - - description: | - Scope Id consisting the UUID of the shared scope - explode: false - in: path - name: scopeId - required: true - schema: - type: string - style: simple - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/SharedScopeUsage' - description: | - OK. - Usages of the shared scope is returned. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "404": - content: - application/json: - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Not Found. The specified resource does not exist. - security: - - OAuth2Security: - - apim:api_view - summary: Get usages of a Shared Scope by Scope Id - tags: - - Scopes - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901/usage"' - x-accepts: application/json - /key-managers: - get: - description: | - Get all Key managers - operationId: getAllKeyManagers - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/KeyManagerList' - description: | - OK. - Categories returned - security: - - OAuth2Security: - - apim:api_create - summary: Get All Key Managers - tags: - - Key Managers (Collection) - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/key-managers"' - x-accepts: application/json - /deployments: - get: - description: | - This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. - - With that you can deploy an API to selected cloud environments. - operationId: deploymentsGet - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentList' - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - explode: false - schema: - type: string - style: simple - "400": - content: - application/json: - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Bad Request. Invalid request or validation error. - "404": - content: - application/json: - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Not Found. The specified resource does not exist. - "500": - content: - application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. - security: - - OAuth2Security: - - apim:api_view - summary: Retrieve Deployment Environments Details + summary: Update a Shared Scope tags: - - Deployments + - Scopes x-code-samples: - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/deployments"' + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' + x-contentType: application/json x-accepts: application/json - /apis/{apiId}/deployments: + /scopes/{scopeId}/usage: get: description: | - This operation can be used to retrieve the status of deployments in cloud clusters. - - With that you can get the status of the deployed APIs in cloud environments. - operationId: deploymentsGetStatus + This operation can be used to retrieve usages of a Shared Scope by a given scope Id. + operationId: getSharedScopeUsages parameters: - description: | - **API ID** consisting of the **UUID** of the API. + Scope Id consisting the UUID of the shared scope explode: false in: path - name: apiId + name: scopeId required: true schema: type: string @@ -13649,9 +13362,10 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/DeploymentStatusList' + $ref: '#/components/schemas/SharedScopeUsage' description: | - OK. Successful response with the list of deployment environments information in the body. + OK. + Usages of the shared scope is returned. headers: Content-Type: description: | @@ -13660,18 +13374,6 @@ paths: schema: type: string style: simple - "400": - content: - application/json: - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - schema: - $ref: '#/components/schemas/Error' - description: Bad Request. Invalid request or validation error. "404": content: application/json: @@ -13684,29 +13386,41 @@ paths: schema: $ref: '#/components/schemas/Error' description: Not Found. The specified resource does not exist. - "500": + security: + - OAuth2Security: + - apim:api_view + summary: Get usages of a Shared Scope by Scope Id + tags: + - Scopes + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901/usage"' + x-accepts: application/json + /key-managers: + get: + description: | + Get all Key managers + operationId: getAllKeyManagers + responses: + "200": content: application/json: - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] schema: - $ref: '#/components/schemas/Error' - description: Internal Server Error. + $ref: '#/components/schemas/KeyManagerList' + description: | + OK. + Categories returned security: - OAuth2Security: - - apim:api_view - summary: Retrieve Deployment Status Details + - apim:api_create + summary: Get All Key Managers tags: - - DeploymentStatus + - Key Managers (Collection) x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/92bc1330-1848-4fe8-b992-c792186c212e/deployments/"' + "https://127.0.0.1:9443/api/am/publisher/v2/key-managers"' x-accepts: application/json /apis/validate-asyncapi: post: @@ -14344,6 +14058,16 @@ components: schema: type: string style: form + deploymentId: + description: | + Base64 URL encoded value of the name of an environment + explode: false + in: path + name: deploymentId + required: true + schema: + type: string + style: simple policyName: description: | Tier name @@ -14730,14 +14454,18 @@ components: type: string category: default: general + example: general + readOnly: true type: string parentCommentId: example: 6f38aea2-f41e-4ac9-b3f2-a9493d00ba97 + readOnly: true type: string entryPoint: enum: - devPortal - publisher + readOnly: true type: string commenterInfo: $ref: '#/components/schemas/CommenterInfo' @@ -14786,10 +14514,12 @@ components: description: | Number of Comments returned. example: 1 + readOnly: true type: integer list: items: $ref: '#/components/schemas/Comment' + readOnly: true type: array pagination: $ref: '#/components/schemas/Pagination' @@ -14821,39 +14551,35 @@ components: limit: 1 count: 1 list: - - hasThumbnail: true - provider: admin + - updatedTime: 2021-02-11 09:57:25 + hasThumbnail: true workflowStatus: APPROVED + description: A calculator API that supports basic operations + type: HTTP + version: 1.0.0 + provider: admin securityScheme: - securityScheme - securityScheme - websubSubscriptionConfiguration: - signingAlgorithm: signingAlgorithm - signatureHeader: signatureHeader - secret: secret name: CalculatorAPI context: CalculatorAPI - description: A calculator API that supports basic operations + createdTime: 2021-02-11 09:57:25 id: 01234567-0123-0123-0123-012345678901 + lifeCycleStatus: CREATED + - updatedTime: 2021-02-11 09:57:25 + hasThumbnail: true + workflowStatus: APPROVED + description: A calculator API that supports basic operations type: HTTP version: 1.0.0 - lifeCycleStatus: CREATED - - hasThumbnail: true provider: admin - workflowStatus: APPROVED securityScheme: - securityScheme - securityScheme - websubSubscriptionConfiguration: - signingAlgorithm: signingAlgorithm - signatureHeader: signatureHeader - secret: secret name: CalculatorAPI context: CalculatorAPI - description: A calculator API that supports basic operations + createdTime: 2021-02-11 09:57:25 id: 01234567-0123-0123-0123-012345678901 - type: HTTP - version: 1.0.0 lifeCycleStatus: CREATED properties: count: @@ -14886,22 +14612,20 @@ components: type: object APIInfo: example: + updatedTime: 2021-02-11 09:57:25 hasThumbnail: true - provider: admin workflowStatus: APPROVED + description: A calculator API that supports basic operations + type: HTTP + version: 1.0.0 + provider: admin securityScheme: - securityScheme - securityScheme - websubSubscriptionConfiguration: - signingAlgorithm: signingAlgorithm - signatureHeader: signatureHeader - secret: secret name: CalculatorAPI context: CalculatorAPI - description: A calculator API that supports basic operations + createdTime: 2021-02-11 09:57:25 id: 01234567-0123-0123-0123-012345678901 - type: HTTP - version: 1.0.0 lifeCycleStatus: CREATED properties: id: @@ -14940,8 +14664,12 @@ components: items: type: string type: array - websubSubscriptionConfiguration: - $ref: '#/components/schemas/APIInfo_websubSubscriptionConfiguration' + createdTime: + example: 2021-02-11 09:57:25 + type: string + updatedTime: + example: 2021-02-11 09:57:25 + type: string title: API Info object with basic API details. type: object Topic: @@ -14955,7 +14683,7 @@ components: example: PizzaShackAPI maxLength: 50 minLength: 1 - pattern: (^[^~!@#;:%^*()+={}|\\<>"',&$\s+]*$) + pattern: (^[^~!@#;:%^*()+={}|\\<>"',&$\s+\[\]\/]*$) type: string mode: example: This is a simple API for Pizza Shack online pizza delivery store. @@ -15004,20 +14732,12 @@ components: createdTime: createdTime id: 01234567-0123-0123-0123-012345678901 wsdlUrl: /apimgt/applicationdata/wsdls/admin--soap1.wsdl - deploymentEnvironments: - - clusterName: - - minikube - type: Kubernetes - - clusterName: - - minikube - type: Kubernetes accessControlRoles: [] visibility: PUBLIC version: 1.0.0 tags: - pizza - food - labels: [] visibleTenants: [] cacheTimeout: 300 enableStore: true @@ -15025,10 +14745,15 @@ components: apiThrottlingPolicy: Unlimited websubSubscriptionConfiguration: signingAlgorithm: signingAlgorithm + enable: false signatureHeader: signatureHeader secret: secret name: PizzaShackAPI revisionedApiId: 01234567-0123-0123-0123-012345678901 + advertiseInfo: + apiOwner: admin + advertised: true + originalDevPortalUrl: https://localhost:9443/devportal additionalProperties: - display: true name: name @@ -15099,16 +14824,8 @@ components: transport: - http - https - endpointSecurity: - password: password - type: BASIC - username: admin revisionId: 1 - businessInformation: - technicalOwnerEmail: technicalowner@wso2.com - businessOwnerEmail: businessowner@wso2.com - businessOwner: businessowner - technicalOwner: technicalowner + businessInformation: "" securityScheme: - oauth2 destinationStatsEnabled: Disabled @@ -15153,7 +14870,7 @@ components: example: PizzaShackAPI maxLength: 50 minLength: 1 - pattern: (^[^~!@#;:%^*()+={}|\\<>"',&$\s+]*$) + pattern: (^[^~!@#;:%^*()+={}|\\<>"',&$\s+\[\]\/]*$) type: string description: example: This is a simple API for Pizza Shack online pizza delivery store. @@ -15168,7 +14885,7 @@ components: example: 1.0.0 maxLength: 30 minLength: 1 - pattern: ^[^~!@#;:%^*()+={}|\\<>"',&/$]+$ + pattern: ^[^~!@#;:%^*()+={}|\\<>"',&/$\[\]\s+\/]+$ type: string provider: description: | @@ -15278,6 +14995,7 @@ components: Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified in tenant or system level will be used. example: Authorization + pattern: (^[^~!@#;:%^*()+={}|\\<>"',&$\s+]*$) type: string securityScheme: description: | @@ -15316,8 +15034,6 @@ components: items: type: string type: array - endpointSecurity: - $ref: '#/components/schemas/APIEndpointSecurity' gatewayEnvironments: description: | List of gateway environments the API is available @@ -15328,21 +15044,6 @@ components: type: array x-otherScopes: - apim:api_publish - deploymentEnvironments: - description: | - List of selected deployment environments and clusters - items: - $ref: '#/components/schemas/DeploymentEnvironments' - type: array - x-otherScopes: - - apim:api_publish - labels: - description: | - Labels of micro-gateway environments attached to the API. - example: [] - items: - type: string - type: array mediationPolicies: example: - name: json_to_xml_in_message @@ -15399,7 +15100,10 @@ components: type: string type: array businessInformation: - $ref: '#/components/schemas/APIBusinessInformation' + allOf: + - $ref: '#/components/schemas/APIBusinessInformation' + x-otherScopes: + - apim:api_publish corsConfiguration: $ref: '#/components/schemas/APICorsConfiguration' websubSubscriptionConfiguration: @@ -15551,6 +15255,8 @@ components: type: object serviceInfo: $ref: '#/components/schemas/API_serviceInfo' + advertiseInfo: + $ref: '#/components/schemas/AdvertiseInfo' required: - context - name @@ -15564,38 +15270,45 @@ components: example: displayName: REVISION 1 description: removed a post resource - createdTime: createdTime + createdTime: 2000-01-23T04:56:07.000+00:00 id: c26b2b9b-4632-4ca4-b6f3-521c8863990c deploymentInfo: - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default apiInfo: id: 01234567-0123-0123-0123-012345678901 properties: displayName: example: REVISION 1 + readOnly: true type: string id: example: c26b2b9b-4632-4ca4-b6f3-521c8863990c + readOnly: true type: string description: example: removed a post resource + maxLength: 255 + minLength: 0 type: string createdTime: + format: date-time + readOnly: true type: string apiInfo: $ref: '#/components/schemas/APIRevisionAPIInfo' deploymentInfo: items: $ref: '#/components/schemas/APIRevisionDeployment' + readOnly: true type: array title: API Info object with basic API details APIRevisionAPIInfo: @@ -15613,35 +15326,35 @@ components: list: - displayName: REVISION 1 description: removed a post resource - createdTime: createdTime + createdTime: 2000-01-23T04:56:07.000+00:00 id: c26b2b9b-4632-4ca4-b6f3-521c8863990c deploymentInfo: - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default apiInfo: id: 01234567-0123-0123-0123-012345678901 - displayName: REVISION 1 description: removed a post resource - createdTime: createdTime + createdTime: 2000-01-23T04:56:07.000+00:00 id: c26b2b9b-4632-4ca4-b6f3-521c8863990c deploymentInfo: - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default apiInfo: id: 01234567-0123-0123-0123-012345678901 @@ -15662,12 +15375,12 @@ components: - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default - revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default properties: list: @@ -15680,14 +15393,18 @@ components: revisionUuid: c26b2b9b-4632-4ca4-b6f3-521c8863990c vhost: mg.wso2.com displayOnDevportal: true - deployedTime: deployedTime + deployedTime: 2000-01-23T04:56:07.000+00:00 name: default properties: revisionUuid: example: c26b2b9b-4632-4ca4-b6f3-521c8863990c + maxLength: 255 + minLength: 0 type: string name: example: default + maxLength: 255 + minLength: 1 type: string vhost: example: mg.wso2.com @@ -15699,6 +15416,8 @@ components: example: true type: boolean deployedTime: + format: date-time + readOnly: true type: string title: APIRevisionDeployment Info object with basic API deployment details AuditReport: @@ -16801,6 +16520,34 @@ components: - unitTime title: Tier type: object + SubscriptionPolicyList: + example: + pagination: + next: next + total: 10 + offset: 0 + previous: previous + limit: 1 + count: 1 + list: + - null + - null + properties: + count: + description: | + Number of Tiers returned. + example: 1 + type: integer + list: + description: | + Array of SubscriptionPolicies + items: + $ref: '#/components/schemas/SubscriptionPolicy' + type: array + pagination: + $ref: '#/components/schemas/Pagination' + title: Subscription policy list + type: object SubscriptionList: example: pagination: @@ -16880,6 +16627,54 @@ components: - throttlingPolicy title: Subscription type: object + ThrottlePolicy: + discriminator: + propertyName: type + properties: + policyId: + description: Id of policy + example: 0c6439fd-9b16-3c2e-be6e-1086e0b9aa93 + readOnly: true + type: string + policyName: + description: Name of policy + example: 30PerMin + maxLength: 60 + minLength: 1 + type: string + displayName: + description: Display name of the policy + example: 30PerMin + maxLength: 512 + type: string + description: + description: Description of the policy + example: Allows 30 request per minute + maxLength: 1024 + type: string + isDeployed: + default: false + description: Indicates whether the policy is deployed successfully or not. + type: boolean + type: + description: Indicates the type of throttle policy + type: string + required: + - policyName + title: Generic Throttling Policy + type: object + GraphQLQuery: + properties: + graphQLMaxComplexity: + description: Maximum Complexity of the GraphQL query + example: 400 + type: integer + graphQLMaxDepth: + description: Maximum Depth of the GraphQL query + example: 10 + type: integer + title: GraphQL Query + type: object ThrottleLimitBase: properties: timeUnit: @@ -16935,52 +16730,24 @@ components: type: object required: - monetizationPlan - - properties - title: API monetization details object - type: object - BandwidthLimit: - allOf: - - $ref: '#/components/schemas/ThrottleLimitBase' - - $ref: '#/components/schemas/BandwidthLimit_allOf' - title: Bandwidth Limit object - RequestCountLimit: - allOf: - - $ref: '#/components/schemas/ThrottleLimitBase' - - $ref: '#/components/schemas/RequestCountLimit_allOf' - title: Request Count Limit object - EventCountLimit: - allOf: - - $ref: '#/components/schemas/ThrottleLimitBase' - - $ref: '#/components/schemas/EventCountLimit_allOf' - title: Event Count Limit object - SubscriptionPolicyList: - example: - pagination: - next: next - total: 10 - offset: 0 - previous: previous - limit: 1 - count: 1 - list: - - null - - null - properties: - count: - description: | - Number of Tiers returned. - example: 1 - type: integer - list: - description: | - Array of SubscriptionPolicies - items: - $ref: '#/components/schemas/SubscriptionPolicy' - type: array - pagination: - $ref: '#/components/schemas/Pagination' - title: Subscription policy list + - properties + title: API monetization details object type: object + BandwidthLimit: + allOf: + - $ref: '#/components/schemas/ThrottleLimitBase' + - $ref: '#/components/schemas/BandwidthLimit_allOf' + title: Bandwidth Limit object + RequestCountLimit: + allOf: + - $ref: '#/components/schemas/ThrottleLimitBase' + - $ref: '#/components/schemas/RequestCountLimit_allOf' + title: Request Count Limit object + EventCountLimit: + allOf: + - $ref: '#/components/schemas/ThrottleLimitBase' + - $ref: '#/components/schemas/EventCountLimit_allOf' + title: Event Count Limit object SubscriptionPolicy: allOf: - $ref: '#/components/schemas/SubscriptionPolicy_allOf' @@ -17112,11 +16879,6 @@ components: type: object Environment: example: - endpoints: - wss: https://localhost:8099 - http: http://localhost:8280 - https: https://localhost:8243 - ws: http://localhost:9099 showInApiConsole: true displayName: Default serverUrl: https://localhost:9443/services/ @@ -17151,8 +16913,6 @@ components: showInApiConsole: example: true type: boolean - endpoints: - $ref: '#/components/schemas/EnvironmentEndpoints' vhosts: items: $ref: '#/components/schemas/VHost' @@ -17178,31 +16938,6 @@ components: type: array title: Environment List type: object - EnvironmentEndpoints: - example: - wss: https://localhost:8099 - http: http://localhost:8280 - https: https://localhost:8243 - ws: http://localhost:9099 - properties: - http: - description: HTTP environment URL - example: http://localhost:8280 - type: string - https: - description: HTTPS environment URL - example: https://localhost:8243 - type: string - ws: - description: WS environment URL - example: http://localhost:9099 - type: string - wss: - description: WSS environment URL - example: https://localhost:8099 - type: string - title: Environment Endpoints - type: object VHost: example: httpContext: pets @@ -17262,32 +16997,7 @@ components: format: int64 type: integer type: object - APIEndpointSecurity: - example: - password: password - type: BASIC - username: admin - properties: - type: - description: Accepts one of the following, basic or digest. - enum: - - BASIC - - DIGEST - example: BASIC - type: string - username: - example: admin - type: string - password: - example: password - type: string - type: object APIBusinessInformation: - example: - technicalOwnerEmail: technicalowner@wso2.com - businessOwnerEmail: businessowner@wso2.com - businessOwner: businessowner - technicalOwner: technicalowner properties: businessOwner: example: businessowner @@ -17308,9 +17018,14 @@ components: WebsubSubscriptionConfiguration: example: signingAlgorithm: signingAlgorithm + enable: false signatureHeader: signatureHeader secret: secret properties: + enable: + default: false + description: Toggle enable WebSub subscription configuration + type: boolean secret: description: Secret key to be used for subscription type: string @@ -17886,57 +17601,6 @@ components: type: string title: Client certificate meta data type: object - Label: - example: - name: marketing_store - access_urls: https://localhost:9095 - description: Public microgateway for marketing - properties: - name: - example: marketing_store - type: string - description: - example: Public microgateway for marketing - type: string - access_urls: - example: https://localhost:9095 - items: - type: string - type: array - required: - - name - title: Label - type: object - LabelList: - example: - pagination: - next: next - total: 10 - offset: 0 - previous: previous - limit: 1 - count: 1 - list: - - name: marketing_store - access_urls: https://localhost:9095 - description: Public microgateway for marketing - - name: marketing_store - access_urls: https://localhost:9095 - description: Public microgateway for marketing - properties: - count: - description: | - Number of Labels returned. - example: 1 - type: integer - list: - items: - $ref: '#/components/schemas/Label' - type: array - pagination: - $ref: '#/components/schemas/Pagination' - title: Label List - type: object LifecycleState: example: state: Created @@ -18496,12 +18160,7 @@ components: devportalUrl: https://localhost:9443/devportal externalStoresEnabled: true environment: - - endpoints: - wss: https://localhost:8099 - http: http://localhost:8280 - https: https://localhost:8243 - ws: http://localhost:9099 - showInApiConsole: true + - showInApiConsole: true displayName: Default serverUrl: https://localhost:9443/services/ name: default @@ -18519,12 +18178,7 @@ components: wsPort: 9099 host: mg.wso2.com httpsPort: 443 - - endpoints: - wss: https://localhost:8099 - http: http://localhost:8280 - https: https://localhost:8243 - ws: http://localhost:9099 - showInApiConsole: true + - showInApiConsole: true displayName: Default serverUrl: https://localhost:9443/services/ name: default @@ -18542,31 +18196,6 @@ components: wsPort: 9099 host: mg.wso2.com httpsPort: 443 - deployments: - - name: Kubernetes - clusters: - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - name: Kubernetes - clusters: - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties crossTenantSubscriptionEnabled: false securityAuditProperties: '{}' scopes: @@ -18614,10 +18243,6 @@ components: Is Cross Tenant Subscriptions Enabled example: false type: boolean - deployments: - items: - $ref: '#/components/schemas/Deployments' - type: array title: SettingsDTO type: object SecurityAuditAttribute: @@ -18753,251 +18378,22 @@ components: $ref: '#/components/schemas/Pagination' title: Tenant list type: object - AlertTypesList: - example: - alerts: - - name: AbnormalRequestTime - id: 1 - requireConfiguration: true - - name: AbnormalRequestTime - id: 1 - requireConfiguration: true - count: 3 - properties: - count: - description: The number of alerts - example: 3 - type: integer - alerts: - items: - $ref: '#/components/schemas/AlertType' - type: array - title: Alert Types List - type: object - AlertType: + AdvertiseInfo: example: - name: AbnormalRequestTime - id: 1 - requireConfiguration: true + apiOwner: admin + advertised: true + originalDevPortalUrl: https://localhost:9443/devportal properties: - id: - description: The alert Id - example: 1 - type: integer - name: - description: The name of the alert. - example: AbnormalRequestTime - type: string - requireConfiguration: - description: Whether the alert type require additional configurations. + advertised: example: true type: boolean - title: Alert Type - type: object - Alert: - example: - configuration: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - name: AbnormalRequestsPerMin - id: 1 - properties: - id: - description: The alert Id - example: 1 - type: integer - name: - description: The name of the alert. - example: AbnormalRequestsPerMin + originalDevPortalUrl: + example: https://localhost:9443/devportal type: string - configuration: - items: - $ref: '#/components/schemas/AlertConfig' - type: array - title: Alert - type: object - AlertsInfo: - example: - alerts: - - configuration: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - name: AbnormalRequestsPerMin - id: 1 - - configuration: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - name: AbnormalRequestsPerMin - id: 1 - emailList: - - emailList - - emailList - properties: - alerts: - items: - $ref: '#/components/schemas/Alert' - type: array - emailList: - items: - type: string - type: array - title: Alerts Info - type: object - AlertsInfoResponse: - example: - alerts: - - configuration: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - name: AbnormalRequestsPerMin - id: 1 - - configuration: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - name: AbnormalRequestsPerMin - id: 1 - emailList: - - emailList - - emailList - failedConfigurations: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - properties: - alerts: - items: - $ref: '#/components/schemas/Alert' - type: array - emailList: - items: - type: string - type: array - failedConfigurations: - items: - $ref: '#/components/schemas/AlertConfig' - type: array - title: Alerts Info Response - type: object - AlertConfigList: - example: - count: 1 - list: - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - properties: - count: - example: 1 - type: integer - list: - items: - $ref: '#/components/schemas/AlertConfig' - type: array - title: Alert Configuration List - type: object - AlertConfig: - example: - configuration: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - configurationId: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - properties: - configurationId: - description: The alert config subscription id. - example: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K + apiOwner: + example: admin type: string - configuration: - additionalProperties: - type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - type: object - title: Alert Configuration - type: object - AlertConfigInfo: - additionalProperties: - type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - title: Alert Configuration Info + title: API Advertise info object with advertise details type: object APICategory: example: @@ -19131,278 +18527,6 @@ components: type: integer title: API Key details to invoke APIs type: object - DeploymentList: - example: - count: 1 - list: - - name: Kubernetes - clusters: - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - name: Kubernetes - clusters: - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - properties: - count: - description: | - Number of deployment clusters returned. - example: 1 - type: integer - list: - items: - $ref: '#/components/schemas/Deployments' - type: array - title: Deployment List - type: object - Deployments: - example: - name: Kubernetes - clusters: - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - properties: - name: - example: Kubernetes - type: string - clusters: - items: - $ref: '#/components/schemas/DeploymentClusterInfo' - type: array - required: - - clusters - - name - title: Deployments - type: object - DeploymentClusterInfo: - example: - accessURL: https://api.com - displayName: kubernetes-minikube - clusterName: minikube - properties: - key: properties - properties: - clusterName: - example: minikube - type: string - accessURL: - example: https://api.com - type: string - displayName: - example: kubernetes-minikube - type: string - properties: - additionalProperties: - type: string - type: object - required: - - accessURL - - clusterName - - displayName - - properties - title: DeploymentClusterInfo - type: object - DeploymentStatusList: - example: - count: 1 - list: - - type: Kubernetes - clusters: - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - - type: Kubernetes - clusters: - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - properties: - count: - description: | - Status of the deployments returned. - example: 1 - type: integer - list: - items: - $ref: '#/components/schemas/DeploymentStatus' - type: array - title: DeploymentStatus List - type: object - DeploymentStatus: - example: - type: Kubernetes - clusters: - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - properties: - type: - example: Kubernetes - type: string - clusters: - items: - $ref: '#/components/schemas/DeploymentClusterStatus' - type: array - required: - - clusters - - type - title: DeploymentStatus - type: object - DeploymentClusterStatus: - example: - podsRunning: 0 - healthStatus: - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - clusterName: Minikube - properties: - clusterName: - example: Minikube - type: string - podsRunning: - type: integer - healthStatus: - items: - $ref: '#/components/schemas/PodStatus' - type: array - required: - - clusterName - - healthStatus - - podsRunning - title: DeploymentClusterStatus - type: object - DeploymentEnvironments: - example: - clusterName: - - minikube - type: Kubernetes - properties: - type: - example: Kubernetes - type: string - clusterName: - example: - - minikube - items: - type: string - type: array - required: - - clusterName - - type - title: DeploymentEnvironments - type: object - PodStatus: - example: - ready: 1/1 - name: petStore-677bb7cc65-shb2f - creationTimestamp: 2020-05-12T06:12:00Z - status: running - properties: - name: - example: petStore-677bb7cc65-shb2f - type: string - ready: - example: 1/1 - type: string - status: - example: running - type: string - creationTimestamp: - example: 2020-05-12T06:12:00Z - type: string - required: - - name - - ready - - status - title: PodStatus - type: object AsyncAPISpecificationValidationResponse: example: isValid: true @@ -19415,6 +18539,7 @@ components: description: description message: message info: + protocol: WEBSUB endpoints: - https://localhost:9443/am/sample/pizzashack/v1/api/ - https://localhost:9443/am/sample/pizzashack/v1/api/ @@ -19451,6 +18576,7 @@ components: description: | Content of the comment example: This is a comment + maxLength: 512 type: string category: description: | @@ -19467,6 +18593,7 @@ components: description: | Content of the comment example: This is a comment + maxLength: 512 type: string category: description: | @@ -19475,18 +18602,6 @@ components: type: string title: Patch request body type: object - APIInfo_websubSubscriptionConfiguration: - example: - signingAlgorithm: signingAlgorithm - signatureHeader: signatureHeader - secret: secret - properties: - secret: - type: string - signingAlgorithm: - type: string - signatureHeader: - type: string API_additionalProperties: example: display: true @@ -19889,6 +19004,7 @@ components: - INLINE - URL - FILE + - MARKDOWN example: INLINE type: string sourceUrl: @@ -19920,6 +19036,7 @@ components: AsyncAPISpecificationValidationResponse_info: description: API definition information example: + protocol: WEBSUB endpoints: - https://localhost:9443/am/sample/pizzashack/v1/api/ - https://localhost:9443/am/sample/pizzashack/v1/api/ @@ -19946,6 +19063,9 @@ components: asyncAPIVersion: example: "2.0" type: string + protocol: + example: WEBSUB + type: string endpoints: description: contains host/servers specified in the AsyncAPI file/URL items: @@ -19964,7 +19084,6 @@ components: apim:api_publish: Publish API apim:subscription_view: View Subscription apim:subscription_block: Block Subscription - apim:external_services_discover: Discover External Services apim:threat_protection_policy_create: Create threat protection policies apim:threat_protection_policy_manage: Update and delete threat protection policies diff --git a/modules/integration/tests-common/clients/publisher/docs/APIDTO.md b/modules/integration/tests-common/clients/publisher/docs/APIDTO.md index 30484dce34..839be6e465 100644 --- a/modules/integration/tests-common/clients/publisher/docs/APIDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/APIDTO.md @@ -37,10 +37,7 @@ Name | Type | Description | Notes **visibility** | [**VisibilityEnum**](#VisibilityEnum) | The visibility level of the API. Accepts one of the following. PUBLIC, PRIVATE, RESTRICTED. | [optional] **visibleRoles** | **List<String>** | The user roles that are able to access the API in Developer Portal | [optional] **visibleTenants** | **List<String>** | | [optional] -**endpointSecurity** | [**APIEndpointSecurityDTO**](APIEndpointSecurityDTO.md) | | [optional] **gatewayEnvironments** | **List<String>** | List of gateway environments the API is available | [optional] -**deploymentEnvironments** | [**List<DeploymentEnvironmentsDTO>**](DeploymentEnvironmentsDTO.md) | List of selected deployment environments and clusters | [optional] -**labels** | **List<String>** | Labels of micro-gateway environments attached to the API. | [optional] **mediationPolicies** | [**List<MediationPolicyDTO>**](MediationPolicyDTO.md) | | [optional] **subscriptionAvailability** | [**SubscriptionAvailabilityEnum**](#SubscriptionAvailabilityEnum) | The subscription availability. Accepts one of the following. CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. | [optional] **subscriptionAvailableTenants** | **List<String>** | | [optional] @@ -62,6 +59,7 @@ Name | Type | Description | Notes **categories** | **List<String>** | API categories | [optional] **keyManagers** | [**Object**](.md) | API Key Managers | [optional] [readonly] **serviceInfo** | [**APIServiceInfoDTO**](APIServiceInfoDTO.md) | | [optional] +**advertiseInfo** | [**AdvertiseInfoDTO**](AdvertiseInfoDTO.md) | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/APIInfoDTO.md b/modules/integration/tests-common/clients/publisher/docs/APIInfoDTO.md index 1bf4b988b4..09603e4e22 100644 --- a/modules/integration/tests-common/clients/publisher/docs/APIInfoDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/APIInfoDTO.md @@ -17,7 +17,8 @@ Name | Type | Description | Notes **workflowStatus** | **String** | | [optional] **hasThumbnail** | **Boolean** | | [optional] **securityScheme** | **List<String>** | | [optional] -**websubSubscriptionConfiguration** | [**APIInfoWebsubSubscriptionConfigurationDTO**](APIInfoWebsubSubscriptionConfigurationDTO.md) | | [optional] +**createdTime** | **String** | | [optional] +**updatedTime** | **String** | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/APIRevisionDTO.md b/modules/integration/tests-common/clients/publisher/docs/APIRevisionDTO.md index a1a0415c4e..f754bda443 100644 --- a/modules/integration/tests-common/clients/publisher/docs/APIRevisionDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/APIRevisionDTO.md @@ -6,12 +6,12 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**displayName** | **String** | | [optional] -**id** | **String** | | [optional] +**displayName** | **String** | | [optional] [readonly] +**id** | **String** | | [optional] [readonly] **description** | **String** | | [optional] -**createdTime** | **String** | | [optional] +**createdTime** | [**Date**](Date.md) | | [optional] [readonly] **apiInfo** | [**APIRevisionAPIInfoDTO**](APIRevisionAPIInfoDTO.md) | | [optional] -**deploymentInfo** | [**List<APIRevisionDeploymentDTO>**](APIRevisionDeploymentDTO.md) | | [optional] +**deploymentInfo** | [**List<APIRevisionDeploymentDTO>**](APIRevisionDeploymentDTO.md) | | [optional] [readonly] diff --git a/modules/integration/tests-common/clients/publisher/docs/APIRevisionDeploymentDTO.md b/modules/integration/tests-common/clients/publisher/docs/APIRevisionDeploymentDTO.md index 73813c13cd..49564bc718 100644 --- a/modules/integration/tests-common/clients/publisher/docs/APIRevisionDeploymentDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/APIRevisionDeploymentDTO.md @@ -10,7 +10,7 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **vhost** | **String** | | [optional] **displayOnDevportal** | **Boolean** | | [optional] -**deployedTime** | **String** | | [optional] +**deployedTime** | [**Date**](Date.md) | | [optional] [readonly] diff --git a/modules/integration/tests-common/clients/publisher/docs/AdvertiseInfoDTO.md b/modules/integration/tests-common/clients/publisher/docs/AdvertiseInfoDTO.md new file mode 100644 index 0000000000..2761afa8e2 --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/docs/AdvertiseInfoDTO.md @@ -0,0 +1,14 @@ + + +# AdvertiseInfoDTO + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**advertised** | **Boolean** | | [optional] +**originalDevPortalUrl** | **String** | | [optional] +**apiOwner** | **String** | | [optional] + + + diff --git a/modules/integration/tests-common/clients/publisher/docs/ApIsApi.md b/modules/integration/tests-common/clients/publisher/docs/ApIsApi.md index 3fa80d8c01..5837fb7214 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ApIsApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/ApIsApi.md @@ -21,7 +21,7 @@ Method | HTTP request | Description [**getWSDLInfoOfAPI**](ApIsApi.md#getWSDLInfoOfAPI) | **GET** /apis/{apiId}/wsdl-info | Get WSDL Meta Information [**getWSDLOfAPI**](ApIsApi.md#getWSDLOfAPI) | **GET** /apis/{apiId}/wsdl | Get WSDL definition [**importAsyncAPISpecification**](ApIsApi.md#importAsyncAPISpecification) | **POST** /apis/import-asyncapi | import an AsyncAPI Specification -[**importGraphQLSchema**](ApIsApi.md#importGraphQLSchema) | **POST** /apis/import-graphql-schema | Import API Definition +[**importGraphQLSchema**](ApIsApi.md#importGraphQLSchema) | **POST** /apis/import-graphql-schema | Import a GraphQL SDL [**importOpenAPIDefinition**](ApIsApi.md#importOpenAPIDefinition) | **POST** /apis/import-openapi | Import an OpenAPI Definition [**importServiceFromCatalog**](ApIsApi.md#importServiceFromCatalog) | **POST** /apis/import-service | Import a Service from Service Catalog [**importWSDLDefinition**](ApIsApi.md#importWSDLDefinition) | **POST** /apis/import-wsdl | Import a WSDL Definition @@ -941,7 +941,7 @@ public class Example { Integer limit = 25; // Integer | Maximum size of resource array to return. Integer offset = 0; // Integer | Starting point within the complete list of items qualified. String xWSO2Tenant = "xWSO2Tenant_example"; // String | For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. - String query = "query_example"; // String | **Search condition**. You can search in attributes by using an **\":\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) + String query = "query_example"; // String | **Search condition**. You can search in attributes by using an **\":\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) String ifNoneMatch = "ifNoneMatch_example"; // String | Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. Boolean expand = true; // Boolean | Defines whether the returned response should contain full details of API String accept = "\"application/json\""; // String | Media types acceptable for the response. Default is application/json. @@ -966,7 +966,7 @@ Name | Type | Description | Notes **limit** | **Integer**| Maximum size of resource array to return. | [optional] [default to 25] **offset** | **Integer**| Starting point within the complete list of items qualified. | [optional] [default to 0] **xWSO2Tenant** | **String**| For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. | [optional] - **query** | **String**| **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) | [optional] + **query** | **String**| **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) | [optional] **ifNoneMatch** | **String**| Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. | [optional] **expand** | **Boolean**| Defines whether the returned response should contain full details of API | [optional] **accept** | **String**| Media types acceptable for the response. Default is application/json. | [optional] [default to "application/json"] @@ -1280,7 +1280,7 @@ Name | Type | Description | Notes # **importGraphQLSchema** > APIDTO importGraphQLSchema(ifMatch, type, file, additionalProperties) -Import API Definition +Import a GraphQL SDL This operation can be used to create api from api definition.APIMgtDAOTest API definition is GraphQL Schema @@ -1353,7 +1353,7 @@ Name | Type | Description | Notes # **importOpenAPIDefinition** -> APIDTO importOpenAPIDefinition(file, url, additionalProperties) +> APIDTO importOpenAPIDefinition(file, url, additionalProperties, inlineAPIDefinition) Import an OpenAPI Definition @@ -1382,8 +1382,9 @@ public class Example { File file = new File("/path/to/file"); // File | Definition to upload as a file String url = "url_example"; // String | Definition url String additionalProperties = "additionalProperties_example"; // String | Additional attributes specified as a stringified JSON with API's schema + String inlineAPIDefinition = "inlineAPIDefinition_example"; // String | Inline content of the OpenAPI definition try { - APIDTO result = apiInstance.importOpenAPIDefinition(file, url, additionalProperties); + APIDTO result = apiInstance.importOpenAPIDefinition(file, url, additionalProperties, inlineAPIDefinition); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ApIsApi#importOpenAPIDefinition"); @@ -1403,6 +1404,7 @@ Name | Type | Description | Notes **file** | **File**| Definition to upload as a file | [optional] **url** | **String**| Definition url | [optional] **additionalProperties** | **String**| Additional attributes specified as a stringified JSON with API's schema | [optional] + **inlineAPIDefinition** | **String**| Inline content of the OpenAPI definition | [optional] ### Return type @@ -1452,7 +1454,7 @@ public class Example { OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); ApIsApi apiInstance = new ApIsApi(defaultClient); - String serviceKey = "serviceKey_example"; // String | ID of service that should be imported from Service Catalog + String serviceKey = Pizzashack-1.0.0; // String | ID of service that should be imported from Service Catalog APIDTO APIDTO = new APIDTO(); // APIDTO | try { APIDTO result = apiInstance.importServiceFromCatalog(serviceKey, APIDTO); diff --git a/modules/integration/tests-common/clients/publisher/docs/ApiProductRevisionsApi.md b/modules/integration/tests-common/clients/publisher/docs/ApiProductRevisionsApi.md index 20fe6ab44d..021c491a22 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ApiProductRevisionsApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/ApiProductRevisionsApi.md @@ -5,13 +5,14 @@ All URIs are relative to *https://apis.wso2.com/api/am/publisher/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**createAPIProductRevision**](ApiProductRevisionsApi.md#createAPIProductRevision) | **POST** /api-products/{apiProductId}/revisions | Create a new API Product revision -[**deleteAPIProductRevision**](ApiProductRevisionsApi.md#deleteAPIProductRevision) | **DELETE** /api-products/{apiProductId}/revisions/{revisionId} | Delete a revision of an API Product -[**deployAPIProductRevision**](ApiProductRevisionsApi.md#deployAPIProductRevision) | **POST** /api-products/{apiProductId}/deploy-revision | Deploy a revision -[**getAPIProductRevision**](ApiProductRevisionsApi.md#getAPIProductRevision) | **GET** /api-products/{apiProductId}/revisions/{revisionId} | Retrieve a revision of an API Product -[**getAPIProductRevisionDeployments**](ApiProductRevisionsApi.md#getAPIProductRevisionDeployments) | **GET** /api-products/{apiProductId}/deploy-revision | List available deployed revision deployment details of an API Product -[**getAPIProductRevisions**](ApiProductRevisionsApi.md#getAPIProductRevisions) | **GET** /api-products/{apiProductId}/revisions | List available revisions of an API Product -[**restoreAPIProductRevision**](ApiProductRevisionsApi.md#restoreAPIProductRevision) | **POST** /api-products/{apiProductId}/restore-revision | Restore a revision -[**undeployAPIProductRevision**](ApiProductRevisionsApi.md#undeployAPIProductRevision) | **POST** /api-products/{apiProductId}/undeploy-revision | Un-Deploy a revision +[**deleteAPIProductRevision**](ApiProductRevisionsApi.md#deleteAPIProductRevision) | **DELETE** /api-products/{apiProductId}/revisions/{revisionId} | Delete Revision +[**deployAPIProductRevision**](ApiProductRevisionsApi.md#deployAPIProductRevision) | **POST** /api-products/{apiProductId}/deploy-revision | Deploy Revision +[**getAPIProductRevision**](ApiProductRevisionsApi.md#getAPIProductRevision) | **GET** /api-products/{apiProductId}/revisions/{revisionId} | Retrieve Revision +[**getAPIProductRevisionDeployments**](ApiProductRevisionsApi.md#getAPIProductRevisionDeployments) | **GET** /api-products/{apiProductId}/deployments | List Deployments +[**getAPIProductRevisions**](ApiProductRevisionsApi.md#getAPIProductRevisions) | **GET** /api-products/{apiProductId}/revisions | List Revisions +[**restoreAPIProductRevision**](ApiProductRevisionsApi.md#restoreAPIProductRevision) | **POST** /api-products/{apiProductId}/restore-revision | Restore Revision +[**undeployAPIProductRevision**](ApiProductRevisionsApi.md#undeployAPIProductRevision) | **POST** /api-products/{apiProductId}/undeploy-revision | UnDeploy Revision +[**updateAPIProductDeployment**](ApiProductRevisionsApi.md#updateAPIProductDeployment) | **PUT** /api-products/{apiProductId}/deployments/{deploymentId} | Update Deployment @@ -89,7 +90,7 @@ Name | Type | Description | Notes # **deleteAPIProductRevision** > APIRevisionListDTO deleteAPIProductRevision(apiProductId, revisionId) -Delete a revision of an API Product +Delete Revision Delete a revision of an API Product @@ -160,9 +161,9 @@ Name | Type | Description | Notes # **deployAPIProductRevision** > deployAPIProductRevision(apiProductId, revisionId, apIRevisionDeploymentDTO) -Deploy a revision +Deploy Revision -Deploy a revision +Deploy an API Product Revision ### Example ```java @@ -226,13 +227,14 @@ null (empty response body) |-------------|-------------|------------------| **200** | OK. | - | **201** | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. | - | +**400** | Bad Request. Invalid request or validation error. | - | **404** | Not Found. The specified resource does not exist. | - | # **getAPIProductRevision** > APIRevisionDTO getAPIProductRevision(apiProductId, revisionId) -Retrieve a revision of an API Product +Retrieve Revision Retrieve a revision of an API Product @@ -302,7 +304,7 @@ Name | Type | Description | Notes # **getAPIProductRevisionDeployments** > APIRevisionDeploymentListDTO getAPIProductRevisionDeployments(apiProductId) -List available deployed revision deployment details of an API Product +List Deployments List available deployed revision deployment details of an API Product @@ -370,7 +372,7 @@ Name | Type | Description | Notes # **getAPIProductRevisions** > APIRevisionListDTO getAPIProductRevisions(apiProductId, query) -List available revisions of an API Product +List Revisions List available revisions of an API Product @@ -440,9 +442,9 @@ Name | Type | Description | Notes # **restoreAPIProductRevision** > APIProductDTO restoreAPIProductRevision(apiProductId, revisionId) -Restore a revision +Restore Revision -Restore a revision to the working copy of the API Product +Restore a revision to the Current API of the API Product ### Example ```java @@ -510,9 +512,9 @@ Name | Type | Description | Notes # **undeployAPIProductRevision** > undeployAPIProductRevision(apiProductId, revisionId, revisionNumber, allEnvironments, apIRevisionDeploymentDTO) -Un-Deploy a revision +UnDeploy Revision -Un-Deploy a revision +UnDeploy an API Product Revision ### Example ```java @@ -580,5 +582,78 @@ null (empty response body) |-------------|-------------|------------------| **200** | OK. | - | **201** | Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. | - | +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | + + +# **updateAPIProductDeployment** +> APIRevisionDeploymentDTO updateAPIProductDeployment(apiProductId, deploymentId, apIRevisionDeploymentDTO) + +Update Deployment + +Update deployment devportal visibility + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ApiProductRevisionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v2"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ApiProductRevisionsApi apiInstance = new ApiProductRevisionsApi(defaultClient); + String apiProductId = "apiProductId_example"; // String | **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. + String deploymentId = "deploymentId_example"; // String | Base64 URL encoded value of the name of an environment + APIRevisionDeploymentDTO apIRevisionDeploymentDTO = new APIRevisionDeploymentDTO(); // APIRevisionDeploymentDTO | Deployment object that needs to be updated + try { + APIRevisionDeploymentDTO result = apiInstance.updateAPIProductDeployment(apiProductId, deploymentId, apIRevisionDeploymentDTO); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiProductRevisionsApi#updateAPIProductDeployment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apiProductId** | **String**| **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. | + **deploymentId** | **String**| Base64 URL encoded value of the name of an environment | + **apIRevisionDeploymentDTO** | [**APIRevisionDeploymentDTO**](APIRevisionDeploymentDTO.md)| Deployment object that needs to be updated | [optional] + +### Return type + +[**APIRevisionDeploymentDTO**](APIRevisionDeploymentDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. | - | **404** | Not Found. The specified resource does not exist. | - | diff --git a/modules/integration/tests-common/clients/publisher/docs/ApiRevisionsApi.md b/modules/integration/tests-common/clients/publisher/docs/ApiRevisionsApi.md index 61aef53a8d..e85cd4720a 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ApiRevisionsApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/ApiRevisionsApi.md @@ -4,21 +4,22 @@ All URIs are relative to *https://apis.wso2.com/api/am/publisher/v2* Method | HTTP request | Description ------------- | ------------- | ------------- -[**createAPIRevision**](ApiRevisionsApi.md#createAPIRevision) | **POST** /apis/{apiId}/revisions | Create a new API revision -[**deleteAPIRevision**](ApiRevisionsApi.md#deleteAPIRevision) | **DELETE** /apis/{apiId}/revisions/{revisionId} | Delete a revision of an API -[**deployAPIRevision**](ApiRevisionsApi.md#deployAPIRevision) | **POST** /apis/{apiId}/deploy-revision | Deploy a revision -[**getAPIRevision**](ApiRevisionsApi.md#getAPIRevision) | **GET** /apis/{apiId}/revisions/{revisionId} | Retrieve a revision of an API -[**getAPIRevisionDeployments**](ApiRevisionsApi.md#getAPIRevisionDeployments) | **GET** /apis/{apiId}/deploy-revision | List available deployed revision deployment details of an API -[**getAPIRevisions**](ApiRevisionsApi.md#getAPIRevisions) | **GET** /apis/{apiId}/revisions | List available revisions of an API -[**restoreAPIRevision**](ApiRevisionsApi.md#restoreAPIRevision) | **POST** /apis/{apiId}/restore-revision | Restore a revision -[**undeployAPIRevision**](ApiRevisionsApi.md#undeployAPIRevision) | **POST** /apis/{apiId}/undeploy-revision | Un-Deploy a revision +[**createAPIRevision**](ApiRevisionsApi.md#createAPIRevision) | **POST** /apis/{apiId}/revisions | Create API Revision +[**deleteAPIRevision**](ApiRevisionsApi.md#deleteAPIRevision) | **DELETE** /apis/{apiId}/revisions/{revisionId} | Delete Revision +[**deployAPIRevision**](ApiRevisionsApi.md#deployAPIRevision) | **POST** /apis/{apiId}/deploy-revision | Deploy Revision +[**getAPIRevision**](ApiRevisionsApi.md#getAPIRevision) | **GET** /apis/{apiId}/revisions/{revisionId} | Retrieve Revision +[**getAPIRevisionDeployments**](ApiRevisionsApi.md#getAPIRevisionDeployments) | **GET** /apis/{apiId}/deployments | List Deployments +[**getAPIRevisions**](ApiRevisionsApi.md#getAPIRevisions) | **GET** /apis/{apiId}/revisions | List Revisions +[**restoreAPIRevision**](ApiRevisionsApi.md#restoreAPIRevision) | **POST** /apis/{apiId}/restore-revision | Restore API Revision +[**undeployAPIRevision**](ApiRevisionsApi.md#undeployAPIRevision) | **POST** /apis/{apiId}/undeploy-revision | UnDeploy Revision +[**updateAPIDeployment**](ApiRevisionsApi.md#updateAPIDeployment) | **PUT** /apis/{apiId}/deployments/{deploymentId} | Update Deployment # **createAPIRevision** > APIRevisionDTO createAPIRevision(apiId, apIRevisionDTO) -Create a new API revision +Create API Revision Create a new API revision @@ -89,7 +90,7 @@ Name | Type | Description | Notes # **deleteAPIRevision** > APIRevisionListDTO deleteAPIRevision(apiId, revisionId) -Delete a revision of an API +Delete Revision Delete a revision of an API @@ -158,9 +159,9 @@ Name | Type | Description | Notes # **deployAPIRevision** -> deployAPIRevision(apiId, revisionId, apIRevisionDeploymentDTO) +> List<APIRevisionDeploymentDTO> deployAPIRevision(apiId, revisionId, apIRevisionDeploymentDTO) -Deploy a revision +Deploy Revision Deploy a revision @@ -188,7 +189,8 @@ public class Example { String revisionId = "revisionId_example"; // String | Revision ID of an API List apIRevisionDeploymentDTO = Arrays.asList(); // List | Deployment object that needs to be added try { - apiInstance.deployAPIRevision(apiId, revisionId, apIRevisionDeploymentDTO); + List result = apiInstance.deployAPIRevision(apiId, revisionId, apIRevisionDeploymentDTO); + System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ApiRevisionsApi#deployAPIRevision"); System.err.println("Status code: " + e.getCode()); @@ -210,7 +212,7 @@ Name | Type | Description | Notes ### Return type -null (empty response body) +[**List<APIRevisionDeploymentDTO>**](APIRevisionDeploymentDTO.md) ### Authorization @@ -224,15 +226,15 @@ null (empty response body) ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | OK. | - | -**201** | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. | - | +**200** | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. | - | +**400** | Bad Request. Invalid request or validation error. | - | **404** | Not Found. The specified resource does not exist. | - | # **getAPIRevision** > APIRevisionDTO getAPIRevision(apiId, revisionId) -Retrieve a revision of an API +Retrieve Revision Retrieve a revision of an API @@ -302,7 +304,7 @@ Name | Type | Description | Notes # **getAPIRevisionDeployments** > APIRevisionDeploymentListDTO getAPIRevisionDeployments(apiId) -List available deployed revision deployment details of an API +List Deployments List available deployed revision deployment details of an API @@ -370,7 +372,7 @@ Name | Type | Description | Notes # **getAPIRevisions** > APIRevisionListDTO getAPIRevisions(apiId, query) -List available revisions of an API +List Revisions List available revisions of an API @@ -440,9 +442,9 @@ Name | Type | Description | Notes # **restoreAPIRevision** > APIDTO restoreAPIRevision(apiId, revisionId) -Restore a revision +Restore API Revision -Restore a revision to the working copy of the API +Restore a revision to the current API of the API ### Example ```java @@ -510,9 +512,9 @@ Name | Type | Description | Notes # **undeployAPIRevision** > undeployAPIRevision(apiId, revisionId, revisionNumber, allEnvironments, apIRevisionDeploymentDTO) -Un-Deploy a revision +UnDeploy Revision -Un-Deploy a revision +UnDeploy a revision ### Example ```java @@ -580,5 +582,78 @@ null (empty response body) |-------------|-------------|------------------| **200** | OK. | - | **201** | Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. | - | +**400** | Bad Request. Invalid request or validation error. | - | +**404** | Not Found. The specified resource does not exist. | - | + + +# **updateAPIDeployment** +> APIRevisionDeploymentDTO updateAPIDeployment(apiId, deploymentId, apIRevisionDeploymentDTO) + +Update Deployment + +Update deployment devportal visibility + +### Example +```java +// Import classes: +import org.wso2.am.integration.clients.publisher.api.ApiClient; +import org.wso2.am.integration.clients.publisher.api.ApiException; +import org.wso2.am.integration.clients.publisher.api.Configuration; +import org.wso2.am.integration.clients.publisher.api.auth.*; +import org.wso2.am.integration.clients.publisher.api.models.*; +import org.wso2.am.integration.clients.publisher.api.v1.ApiRevisionsApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + defaultClient.setBasePath("https://apis.wso2.com/api/am/publisher/v2"); + + // Configure OAuth2 access token for authorization: OAuth2Security + OAuth OAuth2Security = (OAuth) defaultClient.getAuthentication("OAuth2Security"); + OAuth2Security.setAccessToken("YOUR ACCESS TOKEN"); + + ApiRevisionsApi apiInstance = new ApiRevisionsApi(defaultClient); + String apiId = "apiId_example"; // String | **API ID** consisting of the **UUID** of the API. + String deploymentId = "deploymentId_example"; // String | Base64 URL encoded value of the name of an environment + APIRevisionDeploymentDTO apIRevisionDeploymentDTO = new APIRevisionDeploymentDTO(); // APIRevisionDeploymentDTO | Deployment object that needs to be updated + try { + APIRevisionDeploymentDTO result = apiInstance.updateAPIDeployment(apiId, deploymentId, apIRevisionDeploymentDTO); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling ApiRevisionsApi#updateAPIDeployment"); + System.err.println("Status code: " + e.getCode()); + System.err.println("Reason: " + e.getResponseBody()); + System.err.println("Response headers: " + e.getResponseHeaders()); + e.printStackTrace(); + } + } +} +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **apiId** | **String**| **API ID** consisting of the **UUID** of the API. | + **deploymentId** | **String**| Base64 URL encoded value of the name of an environment | + **apIRevisionDeploymentDTO** | [**APIRevisionDeploymentDTO**](APIRevisionDeploymentDTO.md)| Deployment object that needs to be updated | [optional] + +### Return type + +[**APIRevisionDeploymentDTO**](APIRevisionDeploymentDTO.md) + +### Authorization + +[OAuth2Security](../README.md#OAuth2Security) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. | - | **404** | Not Found. The specified resource does not exist. | - | diff --git a/modules/integration/tests-common/clients/publisher/docs/AsyncAPISpecificationValidationResponseInfoDTO.md b/modules/integration/tests-common/clients/publisher/docs/AsyncAPISpecificationValidationResponseInfoDTO.md index 1ee40ee4b9..9e57054415 100644 --- a/modules/integration/tests-common/clients/publisher/docs/AsyncAPISpecificationValidationResponseInfoDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/AsyncAPISpecificationValidationResponseInfoDTO.md @@ -12,6 +12,7 @@ Name | Type | Description | Notes **context** | **String** | | [optional] **description** | **String** | | [optional] **asyncAPIVersion** | **String** | | [optional] +**protocol** | **String** | | [optional] **endpoints** | **List<String>** | contains host/servers specified in the AsyncAPI file/URL | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/CommentDTO.md b/modules/integration/tests-common/clients/publisher/docs/CommentDTO.md index 2270d5282d..514aa1596d 100644 --- a/modules/integration/tests-common/clients/publisher/docs/CommentDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/CommentDTO.md @@ -11,9 +11,9 @@ Name | Type | Description | Notes **createdTime** | **String** | | [optional] [readonly] **createdBy** | **String** | | [optional] [readonly] **updatedTime** | **String** | | [optional] [readonly] -**category** | **String** | | [optional] -**parentCommentId** | **String** | | [optional] -**entryPoint** | [**EntryPointEnum**](#EntryPointEnum) | | [optional] +**category** | **String** | | [optional] [readonly] +**parentCommentId** | **String** | | [optional] [readonly] +**entryPoint** | [**EntryPointEnum**](#EntryPointEnum) | | [optional] [readonly] **commenterInfo** | [**CommenterInfoDTO**](CommenterInfoDTO.md) | | [optional] **replies** | [**CommentListDTO**](CommentListDTO.md) | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/CommentListDTO.md b/modules/integration/tests-common/clients/publisher/docs/CommentListDTO.md index 2bf0594dad..057bacbe4e 100644 --- a/modules/integration/tests-common/clients/publisher/docs/CommentListDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/CommentListDTO.md @@ -6,8 +6,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**count** | **Integer** | Number of Comments returned. | [optional] -**list** | [**List<CommentDTO>**](CommentDTO.md) | | [optional] +**count** | **Integer** | Number of Comments returned. | [optional] [readonly] +**list** | [**List<CommentDTO>**](CommentDTO.md) | | [optional] [readonly] **pagination** | [**PaginationDTO**](PaginationDTO.md) | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/CommentsApi.md b/modules/integration/tests-common/clients/publisher/docs/CommentsApi.md index 18021322ce..6ec47721e2 100644 --- a/modules/integration/tests-common/clients/publisher/docs/CommentsApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/CommentsApi.md @@ -82,7 +82,9 @@ Name | Type | Description | Notes **201** | Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. | * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
| **400** | Bad Request. Invalid request or validation error. | - | **401** | Unauthorized. The user is not authorized. | - | +**404** | Not Found. The specified resource does not exist. | - | **415** | Unsupported Media Type. The entity of the request was not in a supported format. | - | +**500** | Internal Server Error. | - | # **deleteComment** @@ -154,7 +156,10 @@ null (empty response body) |-------------|-------------|------------------| **200** | OK. Resource successfully deleted. | - | **401** | Unauthorized. The user is not authorized. | - | +**403** | Forbidden. The request must be conditional but no condition has been specified. | - | **404** | Not Found. The specified resource does not exist. | - | +**405** | MethodNotAllowed. Request method is known by the server but is not supported by the target resource. | - | +**500** | Internal Server Error. | - | # **editCommentOfAPI** @@ -228,8 +233,10 @@ Name | Type | Description | Notes **200** | OK. Comment updated. | * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
| **400** | Bad Request. Invalid request or validation error. | - | **401** | Unauthorized. The user is not authorized. | - | +**403** | Forbidden. The request must be conditional but no condition has been specified. | - | **404** | Not Found. The specified resource does not exist. | - | **415** | Unsupported Media Type. The entity of the request was not in a supported format. | - | +**500** | Internal Server Error. | - | # **getAllCommentsOfAPI** @@ -305,8 +312,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK. Comments list is returned. | - | -**401** | Unauthorized. The user is not authorized. | - | -**406** | Not Acceptable. The requested media type is not supported. | - | +**404** | Not Found. The specified resource does not exist. | - | +**500** | Internal Server Error. | - | # **getCommentOfAPI** @@ -386,10 +393,10 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK. Comment returned. | * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
| -**304** | Not Modified. Empty body because the client has already the latest version of the requested resource. | - | **401** | Unauthorized. The user is not authorized. | - | **404** | Not Found. The specified resource does not exist. | - | **406** | Not Acceptable. The requested media type is not supported. | - | +**500** | Internal Server Error. | - | # **getRepliesOfComment** @@ -469,8 +476,8 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | OK. Comment returned. | * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
| -**304** | Not Modified. Empty body because the client has already the latest version of the requested resource. | - | **401** | Unauthorized. The user is not authorized. | - | **404** | Not Found. The specified resource does not exist. | - | **406** | Not Acceptable. The requested media type is not supported. | - | +**500** | Internal Server Error. | - | diff --git a/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultAllOfDTO.md b/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultAllOfDTO.md index ec8c3bf46f..1d4bdf380b 100644 --- a/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultAllOfDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultAllOfDTO.md @@ -41,6 +41,7 @@ Name | Value INLINE | "INLINE" URL | "URL" FILE | "FILE" +MARKDOWN | "MARKDOWN" diff --git a/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultDTO.md b/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultDTO.md index 6d93191224..ea9858092f 100644 --- a/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/DocumentSearchResultDTO.md @@ -41,6 +41,7 @@ Name | Value INLINE | "INLINE" URL | "URL" FILE | "FILE" +MARKDOWN | "MARKDOWN" diff --git a/modules/integration/tests-common/clients/publisher/docs/EnvironmentDTO.md b/modules/integration/tests-common/clients/publisher/docs/EnvironmentDTO.md index 0cc17d4cf7..6c3e976727 100644 --- a/modules/integration/tests-common/clients/publisher/docs/EnvironmentDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/EnvironmentDTO.md @@ -11,7 +11,6 @@ Name | Type | Description | Notes **type** | **String** | | **serverUrl** | **String** | | **showInApiConsole** | **Boolean** | | -**endpoints** | [**EnvironmentEndpointsDTO**](EnvironmentEndpointsDTO.md) | | **vhosts** | [**List<VHostDTO>**](VHostDTO.md) | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/GraphQLQueryDTO.md b/modules/integration/tests-common/clients/publisher/docs/GraphQLQueryDTO.md new file mode 100644 index 0000000000..01f8e30312 --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/docs/GraphQLQueryDTO.md @@ -0,0 +1,13 @@ + + +# GraphQLQueryDTO + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**graphQLMaxComplexity** | **Integer** | Maximum Complexity of the GraphQL query | [optional] +**graphQLMaxDepth** | **Integer** | Maximum Depth of the GraphQL query | [optional] + + + diff --git a/modules/integration/tests-common/clients/publisher/docs/SettingsDTO.md b/modules/integration/tests-common/clients/publisher/docs/SettingsDTO.md index ad4ed0f921..bd2dc18649 100644 --- a/modules/integration/tests-common/clients/publisher/docs/SettingsDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/SettingsDTO.md @@ -14,7 +14,6 @@ Name | Type | Description | Notes **externalStoresEnabled** | **Boolean** | Is External Stores configuration enabled | [optional] **docVisibilityEnabled** | **Boolean** | Is Document Visibility configuration enabled | [optional] **crossTenantSubscriptionEnabled** | **Boolean** | Is Cross Tenant Subscriptions Enabled | [optional] -**deployments** | [**List<DeploymentsDTO>**](DeploymentsDTO.md) | | [optional] diff --git a/modules/integration/tests-common/clients/publisher/docs/ThrottlePolicyDTO.md b/modules/integration/tests-common/clients/publisher/docs/ThrottlePolicyDTO.md new file mode 100644 index 0000000000..a3893f0f0d --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/docs/ThrottlePolicyDTO.md @@ -0,0 +1,17 @@ + + +# ThrottlePolicyDTO + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**policyId** | **String** | Id of policy | [optional] [readonly] +**policyName** | **String** | Name of policy | +**displayName** | **String** | Display name of the policy | [optional] +**description** | **String** | Description of the policy | [optional] +**isDeployed** | **Boolean** | Indicates whether the policy is deployed successfully or not. | [optional] +**type** | **String** | Indicates the type of throttle policy | [optional] + + + diff --git a/modules/integration/tests-common/clients/publisher/docs/ValidationApi.md b/modules/integration/tests-common/clients/publisher/docs/ValidationApi.md index 987a48d3fb..2ab0f0ef4a 100644 --- a/modules/integration/tests-common/clients/publisher/docs/ValidationApi.md +++ b/modules/integration/tests-common/clients/publisher/docs/ValidationApi.md @@ -7,7 +7,7 @@ Method | HTTP request | Description [**validateAPI**](ValidationApi.md#validateAPI) | **POST** /apis/validate | Check Given API Context Name already Exists [**validateAsyncAPISpecification**](ValidationApi.md#validateAsyncAPISpecification) | **POST** /apis/validate-asyncapi | Validate an AsyncAPI Specification [**validateEndpoint**](ValidationApi.md#validateEndpoint) | **POST** /apis/validate-endpoint | Check Whether Given Endpoint URL is Valid -[**validateGraphQLSchema**](ValidationApi.md#validateGraphQLSchema) | **POST** /apis/validate-graphql-schema | Validate GraphQL API Definition and Retrieve a Summary +[**validateGraphQLSchema**](ValidationApi.md#validateGraphQLSchema) | **POST** /apis/validate-graphql-schema | Validate a GraphQL SDL [**validateOpenAPIDefinition**](ValidationApi.md#validateOpenAPIDefinition) | **POST** /apis/validate-openapi | Validate an OpenAPI Definition [**validateWSDLDefinition**](ValidationApi.md#validateWSDLDefinition) | **POST** /apis/validate-wsdl | Validate a WSDL Definition @@ -230,7 +230,7 @@ Name | Type | Description | Notes # **validateGraphQLSchema** > GraphQLValidationResponseDTO validateGraphQLSchema(file) -Validate GraphQL API Definition and Retrieve a Summary +Validate a GraphQL SDL This operation can be used to validate a graphQL definition and retrieve a summary. @@ -297,7 +297,7 @@ Name | Type | Description | Notes # **validateOpenAPIDefinition** -> OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(returnContent, url, file) +> OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(returnContent, url, file, inlineAPIDefinition) Validate an OpenAPI Definition @@ -326,8 +326,9 @@ public class Example { Boolean returnContent = false; // Boolean | Specify whether to return the full content of the OpenAPI definition in the response. This is only applicable when using url based validation String url = "url_example"; // String | OpenAPI definition url File file = new File("/path/to/file"); // File | OpenAPI definition as a file + String inlineAPIDefinition = "inlineAPIDefinition_example"; // String | Inline content of the OpenAPI definition try { - OpenAPIDefinitionValidationResponseDTO result = apiInstance.validateOpenAPIDefinition(returnContent, url, file); + OpenAPIDefinitionValidationResponseDTO result = apiInstance.validateOpenAPIDefinition(returnContent, url, file, inlineAPIDefinition); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling ValidationApi#validateOpenAPIDefinition"); @@ -347,6 +348,7 @@ Name | Type | Description | Notes **returnContent** | **Boolean**| Specify whether to return the full content of the OpenAPI definition in the response. This is only applicable when using url based validation | [optional] [default to false] **url** | **String**| OpenAPI definition url | [optional] **file** | **File**| OpenAPI definition as a file | [optional] + **inlineAPIDefinition** | **String**| Inline content of the OpenAPI definition | [optional] ### Return type diff --git a/modules/integration/tests-common/clients/publisher/docs/WebsubSubscriptionConfigurationDTO.md b/modules/integration/tests-common/clients/publisher/docs/WebsubSubscriptionConfigurationDTO.md index e28d4e8107..7507f192a0 100644 --- a/modules/integration/tests-common/clients/publisher/docs/WebsubSubscriptionConfigurationDTO.md +++ b/modules/integration/tests-common/clients/publisher/docs/WebsubSubscriptionConfigurationDTO.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**enable** | **Boolean** | Toggle enable WebSub subscription configuration | [optional] **secret** | **String** | Secret key to be used for subscription | [optional] **signingAlgorithm** | **String** | The algorithm used for signing | [optional] **signatureHeader** | **String** | The header uses to send the signature | [optional] diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiCallback.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiCallback.java index 7be74f26c9..8aa4141579 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiCallback.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiCallback.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiClient.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiClient.java index 14979ae635..3e371595e5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiClient.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiClient.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiException.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiException.java index 8f0e50fbca..059359dd32 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiException.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiException.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiResponse.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiResponse.java index d7ba7cc465..94cd9b1fd9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiResponse.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ApiResponse.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Configuration.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Configuration.java index 2d80f22693..85c6041863 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Configuration.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Configuration.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/GzipRequestInterceptor.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/GzipRequestInterceptor.java index 2dc1da0706..070817825b 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/GzipRequestInterceptor.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/GzipRequestInterceptor.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/JSON.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/JSON.java index 3de054b03c..dd16df16e8 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/JSON.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/JSON.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -58,6 +58,15 @@ public Class getClassForElement(JsonElement readElement) { return getClassByDiscriminator(classByDiscriminatorValue, getDiscriminatorValue(readElement, "name")); } + }) + .registerTypeSelector(ThrottlePolicyDTO.class, new TypeSelector() { + @Override + public Class getClassForElement(JsonElement readElement) { + Map classByDiscriminatorValue = new HashMap(); + classByDiscriminatorValue.put("ThrottlePolicy", ThrottlePolicyDTO.class); + return getClassByDiscriminator(classByDiscriminatorValue, + getDiscriminatorValue(readElement, "type")); + } }) ; GsonBuilder builder = fireBuilder.createGsonBuilder(); diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Pair.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Pair.java index 6d3c3d71ba..b152c6c369 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Pair.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/Pair.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressRequestBody.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressRequestBody.java index 3877996a18..1db9127e38 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressRequestBody.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressRequestBody.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressResponseBody.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressResponseBody.java index 5fe9c9bd52..66cd949e7a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressResponseBody.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/ProgressResponseBody.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/StringUtil.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/StringUtil.java index 3d4d1dfd9f..c8e49eab4b 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/StringUtil.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/StringUtil.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/ApiKeyAuth.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/ApiKeyAuth.java index 3b204b50b6..855bd3c95e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/ApiKeyAuth.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/Authentication.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/Authentication.java index 4fbd041f04..1f3becc3c9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/Authentication.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/Authentication.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBasicAuth.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBasicAuth.java index ea2f7d7dde..72a83ca01c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBasicAuth.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBearerAuth.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBearerAuth.java index 0892723792..673cc46e00 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBearerAuth.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuth.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuth.java index 698f5801de..10572c4c40 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuth.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuth.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuthFlow.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuthFlow.java index a46289b3fc..cc57b47144 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuthFlow.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/auth/OAuthFlow.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertConfigurationApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertConfigurationApi.java deleted file mode 100644 index 930cc92d3e..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertConfigurationApi.java +++ /dev/null @@ -1,441 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertConfigDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertConfigListDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.ErrorDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AlertConfigurationApi { - private ApiClient localVarApiClient; - - public AlertConfigurationApi() { - this(Configuration.getDefaultApiClient()); - } - - public AlertConfigurationApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for addAlertConfig - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param requestBody Configuration for AbnormalRequestCount alert type (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
201 Created. Successful response with newly created object as entity. Location header contains URL of newly created entity. * Location - The location of the newly created entity.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public okhttp3.Call addAlertConfigCall(String alertType, String configurationId, Map requestBody, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = requestBody; - - // create path and map variables - String localVarPath = "/alerts/{alertType}/configurations/{configurationId}" - .replaceAll("\\{" + "alertType" + "\\}", localVarApiClient.escapeString(alertType.toString())) - .replaceAll("\\{" + "configurationId" + "\\}", localVarApiClient.escapeString(configurationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call addAlertConfigValidateBeforeCall(String alertType, String configurationId, Map requestBody, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'alertType' is set - if (alertType == null) { - throw new ApiException("Missing the required parameter 'alertType' when calling addAlertConfig(Async)"); - } - - // verify the required parameter 'configurationId' is set - if (configurationId == null) { - throw new ApiException("Missing the required parameter 'configurationId' when calling addAlertConfig(Async)"); - } - - // verify the required parameter 'requestBody' is set - if (requestBody == null) { - throw new ApiException("Missing the required parameter 'requestBody' when calling addAlertConfig(Async)"); - } - - - okhttp3.Call localVarCall = addAlertConfigCall(alertType, configurationId, requestBody, _callback); - return localVarCall; - - } - - /** - * Add AbnormalRequestsPerMin Alert Configurations. - * This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param requestBody Configuration for AbnormalRequestCount alert type (required) - * @return AlertConfigDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
201 Created. Successful response with newly created object as entity. Location header contains URL of newly created entity. * Location - The location of the newly created entity.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public AlertConfigDTO addAlertConfig(String alertType, String configurationId, Map requestBody) throws ApiException { - ApiResponse localVarResp = addAlertConfigWithHttpInfo(alertType, configurationId, requestBody); - return localVarResp.getData(); - } - - /** - * Add AbnormalRequestsPerMin Alert Configurations. - * This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param requestBody Configuration for AbnormalRequestCount alert type (required) - * @return ApiResponse<AlertConfigDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
201 Created. Successful response with newly created object as entity. Location header contains URL of newly created entity. * Location - The location of the newly created entity.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public ApiResponse addAlertConfigWithHttpInfo(String alertType, String configurationId, Map requestBody) throws ApiException { - okhttp3.Call localVarCall = addAlertConfigValidateBeforeCall(alertType, configurationId, requestBody, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Add AbnormalRequestsPerMin Alert Configurations. (asynchronously) - * This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param requestBody Configuration for AbnormalRequestCount alert type (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
201 Created. Successful response with newly created object as entity. Location header contains URL of newly created entity. * Location - The location of the newly created entity.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public okhttp3.Call addAlertConfigAsync(String alertType, String configurationId, Map requestBody, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = addAlertConfigValidateBeforeCall(alertType, configurationId, requestBody, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for deleteAlertConfig - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. The alert config is deleted successfully. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deleteAlertConfigCall(String alertType, String configurationId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/alerts/{alertType}/configurations/{configurationId}" - .replaceAll("\\{" + "alertType" + "\\}", localVarApiClient.escapeString(alertType.toString())) - .replaceAll("\\{" + "configurationId" + "\\}", localVarApiClient.escapeString(configurationId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deleteAlertConfigValidateBeforeCall(String alertType, String configurationId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'alertType' is set - if (alertType == null) { - throw new ApiException("Missing the required parameter 'alertType' when calling deleteAlertConfig(Async)"); - } - - // verify the required parameter 'configurationId' is set - if (configurationId == null) { - throw new ApiException("Missing the required parameter 'configurationId' when calling deleteAlertConfig(Async)"); - } - - - okhttp3.Call localVarCall = deleteAlertConfigCall(alertType, configurationId, _callback); - return localVarCall; - - } - - /** - * Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - * This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. The alert config is deleted successfully. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public void deleteAlertConfig(String alertType, String configurationId) throws ApiException { - deleteAlertConfigWithHttpInfo(alertType, configurationId); - } - - /** - * Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - * This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. The alert config is deleted successfully. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public ApiResponse deleteAlertConfigWithHttpInfo(String alertType, String configurationId) throws ApiException { - okhttp3.Call localVarCall = deleteAlertConfigValidateBeforeCall(alertType, configurationId, null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. (asynchronously) - * This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param configurationId The alert configuration id. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. The alert config is deleted successfully. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deleteAlertConfigAsync(String alertType, String configurationId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deleteAlertConfigValidateBeforeCall(alertType, configurationId, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } - /** - * Build call for getAllAlertConfigs - * @param alertType The alert type. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The Developer Portal alert configuration. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getAllAlertConfigsCall(String alertType, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/alerts/{alertType}/configurations" - .replaceAll("\\{" + "alertType" + "\\}", localVarApiClient.escapeString(alertType.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getAllAlertConfigsValidateBeforeCall(String alertType, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'alertType' is set - if (alertType == null) { - throw new ApiException("Missing the required parameter 'alertType' when calling getAllAlertConfigs(Async)"); - } - - - okhttp3.Call localVarCall = getAllAlertConfigsCall(alertType, _callback); - return localVarCall; - - } - - /** - * Get All AbnormalRequestsPerMin Alert Configurations - * This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @return AlertConfigListDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The Developer Portal alert configuration. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public AlertConfigListDTO getAllAlertConfigs(String alertType) throws ApiException { - ApiResponse localVarResp = getAllAlertConfigsWithHttpInfo(alertType); - return localVarResp.getData(); - } - - /** - * Get All AbnormalRequestsPerMin Alert Configurations - * This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @return ApiResponse<AlertConfigListDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The Developer Portal alert configuration. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public ApiResponse getAllAlertConfigsWithHttpInfo(String alertType) throws ApiException { - okhttp3.Call localVarCall = getAllAlertConfigsValidateBeforeCall(alertType, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get All AbnormalRequestsPerMin Alert Configurations (asynchronously) - * This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - * @param alertType The alert type. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The Developer Portal alert configuration. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getAllAlertConfigsAsync(String alertType, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getAllAlertConfigsValidateBeforeCall(alertType, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertSubscriptionsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertSubscriptionsApi.java deleted file mode 100644 index 117c9e2bab..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertSubscriptionsApi.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertsInfoDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertsInfoResponseDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.ErrorDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AlertSubscriptionsApi { - private ApiClient localVarApiClient; - - public AlertSubscriptionsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AlertSubscriptionsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for getSubscribedAlertTypes - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of subscribed alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getSubscribedAlertTypesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/alert-subscriptions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getSubscribedAlertTypesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getSubscribedAlertTypesCall(_callback); - return localVarCall; - - } - - /** - * Get the List of API Publisher Alert Types Subscribed by the User - * This operation is used to get the list of subscribed alert types by the user. - * @return AlertsInfoDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of subscribed alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public AlertsInfoDTO getSubscribedAlertTypes() throws ApiException { - ApiResponse localVarResp = getSubscribedAlertTypesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get the List of API Publisher Alert Types Subscribed by the User - * This operation is used to get the list of subscribed alert types by the user. - * @return ApiResponse<AlertsInfoDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of subscribed alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public ApiResponse getSubscribedAlertTypesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getSubscribedAlertTypesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the List of API Publisher Alert Types Subscribed by the User (asynchronously) - * This operation is used to get the list of subscribed alert types by the user. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of subscribed alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getSubscribedAlertTypesAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getSubscribedAlertTypesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for subscribeToAlerts - * @param alertsInfoDTO The alerts list and the email list to subscribe. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
201 OK. Successful response with the newly subscribed alerts. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public okhttp3.Call subscribeToAlertsCall(AlertsInfoDTO alertsInfoDTO, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = alertsInfoDTO; - - // create path and map variables - String localVarPath = "/alert-subscriptions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call subscribeToAlertsValidateBeforeCall(AlertsInfoDTO alertsInfoDTO, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'alertsInfoDTO' is set - if (alertsInfoDTO == null) { - throw new ApiException("Missing the required parameter 'alertsInfoDTO' when calling subscribeToAlerts(Async)"); - } - - - okhttp3.Call localVarCall = subscribeToAlertsCall(alertsInfoDTO, _callback); - return localVarCall; - - } - - /** - * Subscribe to the Selected Tlert types by the User - * This operation is used to get the list of subscribed alert types by the user. - * @param alertsInfoDTO The alerts list and the email list to subscribe. (required) - * @return AlertsInfoResponseDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
201 OK. Successful response with the newly subscribed alerts. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public AlertsInfoResponseDTO subscribeToAlerts(AlertsInfoDTO alertsInfoDTO) throws ApiException { - ApiResponse localVarResp = subscribeToAlertsWithHttpInfo(alertsInfoDTO); - return localVarResp.getData(); - } - - /** - * Subscribe to the Selected Tlert types by the User - * This operation is used to get the list of subscribed alert types by the user. - * @param alertsInfoDTO The alerts list and the email list to subscribe. (required) - * @return ApiResponse<AlertsInfoResponseDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - -
Status Code Description Response Headers
201 OK. Successful response with the newly subscribed alerts. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public ApiResponse subscribeToAlertsWithHttpInfo(AlertsInfoDTO alertsInfoDTO) throws ApiException { - okhttp3.Call localVarCall = subscribeToAlertsValidateBeforeCall(alertsInfoDTO, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Subscribe to the Selected Tlert types by the User (asynchronously) - * This operation is used to get the list of subscribed alert types by the user. - * @param alertsInfoDTO The alerts list and the email list to subscribe. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - -
Status Code Description Response Headers
201 OK. Successful response with the newly subscribed alerts. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
500 Internal Server Error. -
- */ - public okhttp3.Call subscribeToAlertsAsync(AlertsInfoDTO alertsInfoDTO, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = subscribeToAlertsValidateBeforeCall(alertsInfoDTO, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } - /** - * Build call for unsubscribeAllAlerts - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The user is unsubscribed from the alerts successfully. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call unsubscribeAllAlertsCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/alert-subscriptions"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call unsubscribeAllAlertsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = unsubscribeAllAlertsCall(_callback); - return localVarCall; - - } - - /** - * Unsubscribe User from All the Alert Types - * This operation is used to unsubscribe the respective user from all the alert types. - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The user is unsubscribed from the alerts successfully. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public void unsubscribeAllAlerts() throws ApiException { - unsubscribeAllAlertsWithHttpInfo(); - } - - /** - * Unsubscribe User from All the Alert Types - * This operation is used to unsubscribe the respective user from all the alert types. - * @return ApiResponse<Void> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The user is unsubscribed from the alerts successfully. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public ApiResponse unsubscribeAllAlertsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = unsubscribeAllAlertsValidateBeforeCall(null); - return localVarApiClient.execute(localVarCall); - } - - /** - * Unsubscribe User from All the Alert Types (asynchronously) - * This operation is used to unsubscribe the respective user from all the alert types. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The user is unsubscribed from the alerts successfully. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call unsubscribeAllAlertsAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = unsubscribeAllAlertsValidateBeforeCall(_callback); - localVarApiClient.executeAsync(localVarCall, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertsApi.java deleted file mode 100644 index 2c6ceb6508..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AlertsApi.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertTypesListDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.ErrorDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class AlertsApi { - private ApiClient localVarApiClient; - - public AlertsApi() { - this(Configuration.getDefaultApiClient()); - } - - public AlertsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for getPublisherAlertTypes - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of publisher alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getPublisherAlertTypesCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/alert-types"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getPublisherAlertTypesValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getPublisherAlertTypesCall(_callback); - return localVarCall; - - } - - /** - * Get the list of API Publisher alert types. - * This operation is used to get the list of supportd alert types for the 'publisher' agent. - * @return AlertTypesListDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of publisher alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public AlertTypesListDTO getPublisherAlertTypes() throws ApiException { - ApiResponse localVarResp = getPublisherAlertTypesWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get the list of API Publisher alert types. - * This operation is used to get the list of supportd alert types for the 'publisher' agent. - * @return ApiResponse<AlertTypesListDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of publisher alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public ApiResponse getPublisherAlertTypesWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getPublisherAlertTypesValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get the list of API Publisher alert types. (asynchronously) - * This operation is used to get the list of supportd alert types for the 'publisher' agent. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - -
Status Code Description Response Headers
200 OK. The list of publisher alert types are returned. * Content-Type - The content type of the body.
500 Internal Server Error. -
- */ - public okhttp3.Call getPublisherAlertTypesAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getPublisherAlertTypesValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApIsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApIsApi.java index 0ed1a3cbd9..8d8df9af84 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApIsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApIsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -1700,7 +1700,7 @@ public okhttp3.Call getAPIThumbnailAsync(String apiId, String ifNoneMatch, final * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) * @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional) - * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) + * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) * @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. (optional) * @param expand Defines whether the returned response should contain full details of API (optional) * @param accept Media types acceptable for the response. Default is application/json. (optional, default to "application/json") @@ -1787,7 +1787,7 @@ private okhttp3.Call getAllAPIsValidateBeforeCall(Integer limit, Integer offset, * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) * @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional) - * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) + * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) * @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. (optional) * @param expand Defines whether the returned response should contain full details of API (optional) * @param accept Media types acceptable for the response. Default is application/json. (optional, default to "application/json") @@ -1812,7 +1812,7 @@ public APIListDTO getAllAPIs(Integer limit, Integer offset, String xWSO2Tenant, * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) * @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional) - * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) + * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) * @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. (optional) * @param expand Defines whether the returned response should contain full details of API (optional) * @param accept Media types acceptable for the response. Default is application/json. (optional, default to "application/json") @@ -1838,7 +1838,7 @@ public ApiResponse getAllAPIsWithHttpInfo(Integer limit, Integer off * @param limit Maximum size of resource array to return. (optional, default to 25) * @param offset Starting point within the complete list of items qualified. (optional, default to 0) * @param xWSO2Tenant For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be retirieved from. (optional) - * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. \"label:external\" will match an API if it contains a Microgateway label called \"external\". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) + * @param query **Search condition**. You can search in attributes by using an **\"<attribute>:\"** modifier. Eg. \"provider:wso2\" will match an API if the provider of the API contains \"wso2\". \"provider:\"wso2\"\" will match an API if the provider of the API is exactly \"wso2\". \"status:PUBLISHED\" will match an API if the API is in PUBLISHED state. Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) (optional) * @param ifNoneMatch Validator for conditional requests; based on the ETag of the formerly retrieved variant of the resource. (optional) * @param expand Defines whether the returned response should contain full details of API (optional) * @param accept Media types acceptable for the response. Default is application/json. (optional, default to "application/json") @@ -2442,7 +2442,7 @@ private okhttp3.Call importGraphQLSchemaValidateBeforeCall(String ifMatch, Strin } /** - * Import API Definition + * Import a GraphQL SDL * This operation can be used to create api from api definition.APIMgtDAOTest API definition is GraphQL Schema * @param ifMatch Validator for conditional requests; based on ETag. (optional) * @param type Definition type to upload (optional) @@ -2464,7 +2464,7 @@ public APIDTO importGraphQLSchema(String ifMatch, String type, File file, String } /** - * Import API Definition + * Import a GraphQL SDL * This operation can be used to create api from api definition.APIMgtDAOTest API definition is GraphQL Schema * @param ifMatch Validator for conditional requests; based on ETag. (optional) * @param type Definition type to upload (optional) @@ -2487,7 +2487,7 @@ public ApiResponse importGraphQLSchemaWithHttpInfo(String ifMatch, Strin } /** - * Import API Definition (asynchronously) + * Import a GraphQL SDL (asynchronously) * This operation can be used to create api from api definition.APIMgtDAOTest API definition is GraphQL Schema * @param ifMatch Validator for conditional requests; based on ETag. (optional) * @param type Definition type to upload (optional) @@ -2516,6 +2516,7 @@ public okhttp3.Call importGraphQLSchemaAsync(String ifMatch, String type, File f * @param file Definition to upload as a file (optional) * @param url Definition url (optional) * @param additionalProperties Additional attributes specified as a stringified JSON with API's schema (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object @@ -2527,7 +2528,7 @@ public okhttp3.Call importGraphQLSchemaAsync(String ifMatch, String type, File f 415 Unsupported Media Type. The entity of the request was not in a supported format. - */ - public okhttp3.Call importOpenAPIDefinitionCall(File file, String url, String additionalProperties, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importOpenAPIDefinitionCall(File file, String url, String additionalProperties, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -2550,6 +2551,10 @@ public okhttp3.Call importOpenAPIDefinitionCall(File file, String url, String ad localVarFormParams.put("additionalProperties", additionalProperties); } + if (inlineAPIDefinition != null) { + localVarFormParams.put("inlineAPIDefinition", inlineAPIDefinition); + } + final String[] localVarAccepts = { "application/json" }; @@ -2569,10 +2574,10 @@ public okhttp3.Call importOpenAPIDefinitionCall(File file, String url, String ad } @SuppressWarnings("rawtypes") - private okhttp3.Call importOpenAPIDefinitionValidateBeforeCall(File file, String url, String additionalProperties, final ApiCallback _callback) throws ApiException { + private okhttp3.Call importOpenAPIDefinitionValidateBeforeCall(File file, String url, String additionalProperties, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = importOpenAPIDefinitionCall(file, url, additionalProperties, _callback); + okhttp3.Call localVarCall = importOpenAPIDefinitionCall(file, url, additionalProperties, inlineAPIDefinition, _callback); return localVarCall; } @@ -2583,6 +2588,7 @@ private okhttp3.Call importOpenAPIDefinitionValidateBeforeCall(File file, String * @param file Definition to upload as a file (optional) * @param url Definition url (optional) * @param additionalProperties Additional attributes specified as a stringified JSON with API's schema (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @return APIDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2593,8 +2599,8 @@ private okhttp3.Call importOpenAPIDefinitionValidateBeforeCall(File file, String 415 Unsupported Media Type. The entity of the request was not in a supported format. - */ - public APIDTO importOpenAPIDefinition(File file, String url, String additionalProperties) throws ApiException { - ApiResponse localVarResp = importOpenAPIDefinitionWithHttpInfo(file, url, additionalProperties); + public APIDTO importOpenAPIDefinition(File file, String url, String additionalProperties, String inlineAPIDefinition) throws ApiException { + ApiResponse localVarResp = importOpenAPIDefinitionWithHttpInfo(file, url, additionalProperties, inlineAPIDefinition); return localVarResp.getData(); } @@ -2604,6 +2610,7 @@ public APIDTO importOpenAPIDefinition(File file, String url, String additionalPr * @param file Definition to upload as a file (optional) * @param url Definition url (optional) * @param additionalProperties Additional attributes specified as a stringified JSON with API's schema (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @return ApiResponse<APIDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -2614,8 +2621,8 @@ public APIDTO importOpenAPIDefinition(File file, String url, String additionalPr 415 Unsupported Media Type. The entity of the request was not in a supported format. - */ - public ApiResponse importOpenAPIDefinitionWithHttpInfo(File file, String url, String additionalProperties) throws ApiException { - okhttp3.Call localVarCall = importOpenAPIDefinitionValidateBeforeCall(file, url, additionalProperties, null); + public ApiResponse importOpenAPIDefinitionWithHttpInfo(File file, String url, String additionalProperties, String inlineAPIDefinition) throws ApiException { + okhttp3.Call localVarCall = importOpenAPIDefinitionValidateBeforeCall(file, url, additionalProperties, inlineAPIDefinition, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -2626,6 +2633,7 @@ public ApiResponse importOpenAPIDefinitionWithHttpInfo(File file, String * @param file Definition to upload as a file (optional) * @param url Definition url (optional) * @param additionalProperties Additional attributes specified as a stringified JSON with API's schema (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -2637,9 +2645,9 @@ public ApiResponse importOpenAPIDefinitionWithHttpInfo(File file, String 415 Unsupported Media Type. The entity of the request was not in a supported format. - */ - public okhttp3.Call importOpenAPIDefinitionAsync(File file, String url, String additionalProperties, final ApiCallback _callback) throws ApiException { + public okhttp3.Call importOpenAPIDefinitionAsync(File file, String url, String additionalProperties, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = importOpenAPIDefinitionValidateBeforeCall(file, url, additionalProperties, _callback); + okhttp3.Call localVarCall = importOpenAPIDefinitionValidateBeforeCall(file, url, additionalProperties, inlineAPIDefinition, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiAuditApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiAuditApi.java index 1944ff3fb4..49a73e9ea5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiAuditApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiAuditApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiCategoryCollectionApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiCategoryCollectionApi.java index 817d8d25ba..afee0f7fb2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiCategoryCollectionApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiCategoryCollectionApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiDocumentsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiDocumentsApi.java index fe73fdd0e6..3986695b4b 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiDocumentsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiDocumentsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiLifecycleApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiLifecycleApi.java index 454b6b2c74..c87a97d30d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiLifecycleApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiLifecycleApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPoliciesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPoliciesApi.java index 3e23c2286b..b7d692658d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPoliciesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPoliciesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPolicyApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPolicyApi.java index 8c217c5f0b..dbe49a2370 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPolicyApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMediationPolicyApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMonetizationApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMonetizationApi.java index ef940cadbb..1404b12b1e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMonetizationApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiMonetizationApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductDocumentsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductDocumentsApi.java index 1c3086a6e4..9d1f718507 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductDocumentsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductDocumentsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductRevisionsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductRevisionsApi.java index ed218cb30b..d548a580f9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductRevisionsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductRevisionsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -248,7 +248,7 @@ private okhttp3.Call deleteAPIProductRevisionValidateBeforeCall(String apiProduc } /** - * Delete a revision of an API Product + * Delete Revision * Delete a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -268,7 +268,7 @@ public APIRevisionListDTO deleteAPIProductRevision(String apiProductId, String r } /** - * Delete a revision of an API Product + * Delete Revision * Delete a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -289,7 +289,7 @@ public ApiResponse deleteAPIProductRevisionWithHttpInfo(Stri } /** - * Delete a revision of an API Product (asynchronously) + * Delete Revision (asynchronously) * Delete a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -324,6 +324,7 @@ public okhttp3.Call deleteAPIProductRevisionAsync(String apiProductId, String re Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -376,8 +377,8 @@ private okhttp3.Call deployAPIProductRevisionValidateBeforeCall(String apiProduc } /** - * Deploy a revision - * Deploy a revision + * Deploy Revision + * Deploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param apIRevisionDeploymentDTO Deployment object that needs to be added (optional) @@ -387,6 +388,7 @@ private okhttp3.Call deployAPIProductRevisionValidateBeforeCall(String apiProduc Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -395,8 +397,8 @@ public void deployAPIProductRevision(String apiProductId, String revisionId, Lis } /** - * Deploy a revision - * Deploy a revision + * Deploy Revision + * Deploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param apIRevisionDeploymentDTO Deployment object that needs to be added (optional) @@ -407,6 +409,7 @@ public void deployAPIProductRevision(String apiProductId, String revisionId, Lis Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -416,8 +419,8 @@ public ApiResponse deployAPIProductRevisionWithHttpInfo(String apiProductI } /** - * Deploy a revision (asynchronously) - * Deploy a revision + * Deploy Revision (asynchronously) + * Deploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param apIRevisionDeploymentDTO Deployment object that needs to be added (optional) @@ -429,6 +432,7 @@ public ApiResponse deployAPIProductRevisionWithHttpInfo(String apiProductI Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -503,7 +507,7 @@ private okhttp3.Call getAPIProductRevisionValidateBeforeCall(String apiProductId } /** - * Retrieve a revision of an API Product + * Retrieve Revision * Retrieve a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -522,7 +526,7 @@ public APIRevisionDTO getAPIProductRevision(String apiProductId, String revision } /** - * Retrieve a revision of an API Product + * Retrieve Revision * Retrieve a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -542,7 +546,7 @@ public ApiResponse getAPIProductRevisionWithHttpInfo(String apiP } /** - * Retrieve a revision of an API Product (asynchronously) + * Retrieve Revision (asynchronously) * Retrieve a revision of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (required) @@ -580,7 +584,7 @@ public okhttp3.Call getAPIProductRevisionDeploymentsCall(String apiProductId, fi Object localVarPostBody = null; // create path and map variables - String localVarPath = "/api-products/{apiProductId}/deploy-revision" + String localVarPath = "/api-products/{apiProductId}/deployments" .replaceAll("\\{" + "apiProductId" + "\\}", localVarApiClient.escapeString(apiProductId.toString())); List localVarQueryParams = new ArrayList(); @@ -621,7 +625,7 @@ private okhttp3.Call getAPIProductRevisionDeploymentsValidateBeforeCall(String a } /** - * List available deployed revision deployment details of an API Product + * List Deployments * List available deployed revision deployment details of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @return APIRevisionDeploymentListDTO @@ -639,7 +643,7 @@ public APIRevisionDeploymentListDTO getAPIProductRevisionDeployments(String apiP } /** - * List available deployed revision deployment details of an API Product + * List Deployments * List available deployed revision deployment details of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @return ApiResponse<APIRevisionDeploymentListDTO> @@ -658,7 +662,7 @@ public ApiResponse getAPIProductRevisionDeployment } /** - * List available deployed revision deployment details of an API Product (asynchronously) + * List Deployments (asynchronously) * List available deployed revision deployment details of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param _callback The callback to be executed when the API call finishes @@ -741,7 +745,7 @@ private okhttp3.Call getAPIProductRevisionsValidateBeforeCall(String apiProductI } /** - * List available revisions of an API Product + * List Revisions * List available revisions of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param query (optional) @@ -760,7 +764,7 @@ public APIRevisionListDTO getAPIProductRevisions(String apiProductId, String que } /** - * List available revisions of an API Product + * List Revisions * List available revisions of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param query (optional) @@ -780,7 +784,7 @@ public ApiResponse getAPIProductRevisionsWithHttpInfo(String } /** - * List available revisions of an API Product (asynchronously) + * List Revisions (asynchronously) * List available revisions of an API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param query (optional) @@ -864,8 +868,8 @@ private okhttp3.Call restoreAPIProductRevisionValidateBeforeCall(String apiProdu } /** - * Restore a revision - * Restore a revision to the working copy of the API Product + * Restore Revision + * Restore a revision to the Current API of the API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @return APIProductDTO @@ -883,8 +887,8 @@ public APIProductDTO restoreAPIProductRevision(String apiProductId, String revis } /** - * Restore a revision - * Restore a revision to the working copy of the API Product + * Restore Revision + * Restore a revision to the Current API of the API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @return ApiResponse<APIProductDTO> @@ -903,8 +907,8 @@ public ApiResponse restoreAPIProductRevisionWithHttpInfo(String a } /** - * Restore a revision (asynchronously) - * Restore a revision to the working copy of the API Product + * Restore Revision (asynchronously) + * Restore a revision to the Current API of the API Product * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param _callback The callback to be executed when the API call finishes @@ -939,6 +943,7 @@ public okhttp3.Call restoreAPIProductRevisionAsync(String apiProductId, String r Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -999,8 +1004,8 @@ private okhttp3.Call undeployAPIProductRevisionValidateBeforeCall(String apiProd } /** - * Un-Deploy a revision - * Un-Deploy a revision + * UnDeploy Revision + * UnDeploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1012,6 +1017,7 @@ private okhttp3.Call undeployAPIProductRevisionValidateBeforeCall(String apiProd Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1020,8 +1026,8 @@ public void undeployAPIProductRevision(String apiProductId, String revisionId, S } /** - * Un-Deploy a revision - * Un-Deploy a revision + * UnDeploy Revision + * UnDeploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1034,6 +1040,7 @@ public void undeployAPIProductRevision(String apiProductId, String revisionId, S Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1043,8 +1050,8 @@ public ApiResponse undeployAPIProductRevisionWithHttpInfo(String apiProduc } /** - * Un-Deploy a revision (asynchronously) - * Un-Deploy a revision + * UnDeploy Revision (asynchronously) + * UnDeploy an API Product Revision * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1058,6 +1065,7 @@ public ApiResponse undeployAPIProductRevisionWithHttpInfo(String apiProduc Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1067,4 +1075,133 @@ public okhttp3.Call undeployAPIProductRevisionAsync(String apiProductId, String localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for updateAPIProductDeployment + * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public okhttp3.Call updateAPIProductDeploymentCall(String apiProductId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = apIRevisionDeploymentDTO; + + // create path and map variables + String localVarPath = "/api-products/{apiProductId}/deployments/{deploymentId}" + .replaceAll("\\{" + "apiProductId" + "\\}", localVarApiClient.escapeString(apiProductId.toString())) + .replaceAll("\\{" + "deploymentId" + "\\}", localVarApiClient.escapeString(deploymentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAPIProductDeploymentValidateBeforeCall(String apiProductId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'apiProductId' is set + if (apiProductId == null) { + throw new ApiException("Missing the required parameter 'apiProductId' when calling updateAPIProductDeployment(Async)"); + } + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + throw new ApiException("Missing the required parameter 'deploymentId' when calling updateAPIProductDeployment(Async)"); + } + + + okhttp3.Call localVarCall = updateAPIProductDeploymentCall(apiProductId, deploymentId, apIRevisionDeploymentDTO, _callback); + return localVarCall; + + } + + /** + * Update Deployment + * Update deployment devportal visibility + * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @return APIRevisionDeploymentDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public APIRevisionDeploymentDTO updateAPIProductDeployment(String apiProductId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO) throws ApiException { + ApiResponse localVarResp = updateAPIProductDeploymentWithHttpInfo(apiProductId, deploymentId, apIRevisionDeploymentDTO); + return localVarResp.getData(); + } + + /** + * Update Deployment + * Update deployment devportal visibility + * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @return ApiResponse<APIRevisionDeploymentDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public ApiResponse updateAPIProductDeploymentWithHttpInfo(String apiProductId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO) throws ApiException { + okhttp3.Call localVarCall = updateAPIProductDeploymentValidateBeforeCall(apiProductId, deploymentId, apIRevisionDeploymentDTO, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Deployment (asynchronously) + * Update deployment devportal visibility + * @param apiProductId **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public okhttp3.Call updateAPIProductDeploymentAsync(String apiProductId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAPIProductDeploymentValidateBeforeCall(apiProductId, deploymentId, apIRevisionDeploymentDTO, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductsApi.java index 3556834e88..abbdc4c077 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiProductsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiResourcePoliciesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiResourcePoliciesApi.java index e9c6f92144..f12c88888e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiResourcePoliciesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiResourcePoliciesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiRevisionsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiRevisionsApi.java index 232abe1824..f91de19b3d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiRevisionsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ApiRevisionsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -119,7 +119,7 @@ private okhttp3.Call createAPIRevisionValidateBeforeCall(String apiId, APIRevisi } /** - * Create a new API revision + * Create API Revision * Create a new API revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param apIRevisionDTO API object that needs to be added (optional) @@ -139,7 +139,7 @@ public APIRevisionDTO createAPIRevision(String apiId, APIRevisionDTO apIRevision } /** - * Create a new API revision + * Create API Revision * Create a new API revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param apIRevisionDTO API object that needs to be added (optional) @@ -160,7 +160,7 @@ public ApiResponse createAPIRevisionWithHttpInfo(String apiId, A } /** - * Create a new API revision (asynchronously) + * Create API Revision (asynchronously) * Create a new API revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param apIRevisionDTO API object that needs to be added (optional) @@ -248,7 +248,7 @@ private okhttp3.Call deleteAPIRevisionValidateBeforeCall(String apiId, String re } /** - * Delete a revision of an API + * Delete Revision * Delete a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -268,7 +268,7 @@ public APIRevisionListDTO deleteAPIRevision(String apiId, String revisionId) thr } /** - * Delete a revision of an API + * Delete Revision * Delete a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -289,7 +289,7 @@ public ApiResponse deleteAPIRevisionWithHttpInfo(String apiI } /** - * Delete a revision of an API (asynchronously) + * Delete Revision (asynchronously) * Delete a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -322,8 +322,8 @@ public okhttp3.Call deleteAPIRevisionAsync(String apiId, String revisionId, fina * @http.response.details - - + +
Status Code Description Response Headers
200 OK. -
201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
200 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
*/ @@ -376,47 +376,50 @@ private okhttp3.Call deployAPIRevisionValidateBeforeCall(String apiId, String re } /** - * Deploy a revision + * Deploy Revision * Deploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param apIRevisionDeploymentDTO Deployment object that needs to be added (optional) + * @return List<APIRevisionDeploymentDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + +
Status Code Description Response Headers
200 OK. -
201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
200 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
*/ - public void deployAPIRevision(String apiId, String revisionId, List apIRevisionDeploymentDTO) throws ApiException { - deployAPIRevisionWithHttpInfo(apiId, revisionId, apIRevisionDeploymentDTO); + public List deployAPIRevision(String apiId, String revisionId, List apIRevisionDeploymentDTO) throws ApiException { + ApiResponse> localVarResp = deployAPIRevisionWithHttpInfo(apiId, revisionId, apIRevisionDeploymentDTO); + return localVarResp.getData(); } /** - * Deploy a revision + * Deploy Revision * Deploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param apIRevisionDeploymentDTO Deployment object that needs to be added (optional) - * @return ApiResponse<Void> + * @return ApiResponse<List<APIRevisionDeploymentDTO>> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details - - + +
Status Code Description Response Headers
200 OK. -
201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
200 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
*/ - public ApiResponse deployAPIRevisionWithHttpInfo(String apiId, String revisionId, List apIRevisionDeploymentDTO) throws ApiException { + public ApiResponse> deployAPIRevisionWithHttpInfo(String apiId, String revisionId, List apIRevisionDeploymentDTO) throws ApiException { okhttp3.Call localVarCall = deployAPIRevisionValidateBeforeCall(apiId, revisionId, apIRevisionDeploymentDTO, null); - return localVarApiClient.execute(localVarCall); + Type localVarReturnType = new TypeToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); } /** - * Deploy a revision (asynchronously) + * Deploy Revision (asynchronously) * Deploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) @@ -427,15 +430,16 @@ public ApiResponse deployAPIRevisionWithHttpInfo(String apiId, String revi * @http.response.details - - + +
Status Code Description Response Headers
200 OK. -
201 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
200 Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. -
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
*/ - public okhttp3.Call deployAPIRevisionAsync(String apiId, String revisionId, List apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + public okhttp3.Call deployAPIRevisionAsync(String apiId, String revisionId, List apIRevisionDeploymentDTO, final ApiCallback> _callback) throws ApiException { okhttp3.Call localVarCall = deployAPIRevisionValidateBeforeCall(apiId, revisionId, apIRevisionDeploymentDTO, _callback); - localVarApiClient.executeAsync(localVarCall, _callback); + Type localVarReturnType = new TypeToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; } /** @@ -503,7 +507,7 @@ private okhttp3.Call getAPIRevisionValidateBeforeCall(String apiId, String revis } /** - * Retrieve a revision of an API + * Retrieve Revision * Retrieve a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -522,7 +526,7 @@ public APIRevisionDTO getAPIRevision(String apiId, String revisionId) throws Api } /** - * Retrieve a revision of an API + * Retrieve Revision * Retrieve a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -542,7 +546,7 @@ public ApiResponse getAPIRevisionWithHttpInfo(String apiId, Stri } /** - * Retrieve a revision of an API (asynchronously) + * Retrieve Revision (asynchronously) * Retrieve a revision of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (required) @@ -580,7 +584,7 @@ public okhttp3.Call getAPIRevisionDeploymentsCall(String apiId, final ApiCallbac Object localVarPostBody = null; // create path and map variables - String localVarPath = "/apis/{apiId}/deploy-revision" + String localVarPath = "/apis/{apiId}/deployments" .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); List localVarQueryParams = new ArrayList(); @@ -621,7 +625,7 @@ private okhttp3.Call getAPIRevisionDeploymentsValidateBeforeCall(String apiId, f } /** - * List available deployed revision deployment details of an API + * List Deployments * List available deployed revision deployment details of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @return APIRevisionDeploymentListDTO @@ -639,7 +643,7 @@ public APIRevisionDeploymentListDTO getAPIRevisionDeployments(String apiId) thro } /** - * List available deployed revision deployment details of an API + * List Deployments * List available deployed revision deployment details of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @return ApiResponse<APIRevisionDeploymentListDTO> @@ -658,7 +662,7 @@ public ApiResponse getAPIRevisionDeploymentsWithHt } /** - * List available deployed revision deployment details of an API (asynchronously) + * List Deployments (asynchronously) * List available deployed revision deployment details of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param _callback The callback to be executed when the API call finishes @@ -741,7 +745,7 @@ private okhttp3.Call getAPIRevisionsValidateBeforeCall(String apiId, String quer } /** - * List available revisions of an API + * List Revisions * List available revisions of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param query (optional) @@ -760,7 +764,7 @@ public APIRevisionListDTO getAPIRevisions(String apiId, String query) throws Api } /** - * List available revisions of an API + * List Revisions * List available revisions of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param query (optional) @@ -780,7 +784,7 @@ public ApiResponse getAPIRevisionsWithHttpInfo(String apiId, } /** - * List available revisions of an API (asynchronously) + * List Revisions (asynchronously) * List available revisions of an API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param query (optional) @@ -864,8 +868,8 @@ private okhttp3.Call restoreAPIRevisionValidateBeforeCall(String apiId, String r } /** - * Restore a revision - * Restore a revision to the working copy of the API + * Restore API Revision + * Restore a revision to the current API of the API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @return APIDTO @@ -883,8 +887,8 @@ public APIDTO restoreAPIRevision(String apiId, String revisionId) throws ApiExce } /** - * Restore a revision - * Restore a revision to the working copy of the API + * Restore API Revision + * Restore a revision to the current API of the API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @return ApiResponse<APIDTO> @@ -903,8 +907,8 @@ public ApiResponse restoreAPIRevisionWithHttpInfo(String apiId, String r } /** - * Restore a revision (asynchronously) - * Restore a revision to the working copy of the API + * Restore API Revision (asynchronously) + * Restore a revision to the current API of the API * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param _callback The callback to be executed when the API call finishes @@ -939,6 +943,7 @@ public okhttp3.Call restoreAPIRevisionAsync(String apiId, String revisionId, fin Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -999,8 +1004,8 @@ private okhttp3.Call undeployAPIRevisionValidateBeforeCall(String apiId, String } /** - * Un-Deploy a revision - * Un-Deploy a revision + * UnDeploy Revision + * UnDeploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1012,6 +1017,7 @@ private okhttp3.Call undeployAPIRevisionValidateBeforeCall(String apiId, String Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1020,8 +1026,8 @@ public void undeployAPIRevision(String apiId, String revisionId, String revision } /** - * Un-Deploy a revision - * Un-Deploy a revision + * UnDeploy Revision + * UnDeploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1034,6 +1040,7 @@ public void undeployAPIRevision(String apiId, String revisionId, String revision Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1043,8 +1050,8 @@ public ApiResponse undeployAPIRevisionWithHttpInfo(String apiId, String re } /** - * Un-Deploy a revision (asynchronously) - * Un-Deploy a revision + * UnDeploy Revision (asynchronously) + * UnDeploy a revision * @param apiId **API ID** consisting of the **UUID** of the API. (required) * @param revisionId Revision ID of an API (optional) * @param revisionNumber Revision Number of an API (optional) @@ -1058,6 +1065,7 @@ public ApiResponse undeployAPIRevisionWithHttpInfo(String apiId, String re Status Code Description Response Headers 200 OK. - 201 Created. Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - + 400 Bad Request. Invalid request or validation error. - 404 Not Found. The specified resource does not exist. - */ @@ -1067,4 +1075,133 @@ public okhttp3.Call undeployAPIRevisionAsync(String apiId, String revisionId, St localVarApiClient.executeAsync(localVarCall, _callback); return localVarCall; } + /** + * Build call for updateAPIDeployment + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public okhttp3.Call updateAPIDeploymentCall(String apiId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + Object localVarPostBody = apIRevisionDeploymentDTO; + + // create path and map variables + String localVarPath = "/apis/{apiId}/deployments/{deploymentId}" + .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())) + .replaceAll("\\{" + "deploymentId" + "\\}", localVarApiClient.escapeString(deploymentId.toString())); + + List localVarQueryParams = new ArrayList(); + List localVarCollectionQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + localVarHeaderParams.put("Content-Type", localVarContentType); + + String[] localVarAuthNames = new String[] { "OAuth2Security" }; + return localVarApiClient.buildCall(localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAPIDeploymentValidateBeforeCall(String apiId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + + // verify the required parameter 'apiId' is set + if (apiId == null) { + throw new ApiException("Missing the required parameter 'apiId' when calling updateAPIDeployment(Async)"); + } + + // verify the required parameter 'deploymentId' is set + if (deploymentId == null) { + throw new ApiException("Missing the required parameter 'deploymentId' when calling updateAPIDeployment(Async)"); + } + + + okhttp3.Call localVarCall = updateAPIDeploymentCall(apiId, deploymentId, apIRevisionDeploymentDTO, _callback); + return localVarCall; + + } + + /** + * Update Deployment + * Update deployment devportal visibility + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @return APIRevisionDeploymentDTO + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public APIRevisionDeploymentDTO updateAPIDeployment(String apiId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO) throws ApiException { + ApiResponse localVarResp = updateAPIDeploymentWithHttpInfo(apiId, deploymentId, apIRevisionDeploymentDTO); + return localVarResp.getData(); + } + + /** + * Update Deployment + * Update deployment devportal visibility + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @return ApiResponse<APIRevisionDeploymentDTO> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public ApiResponse updateAPIDeploymentWithHttpInfo(String apiId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO) throws ApiException { + okhttp3.Call localVarCall = updateAPIDeploymentValidateBeforeCall(apiId, deploymentId, apIRevisionDeploymentDTO, null); + Type localVarReturnType = new TypeToken(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Deployment (asynchronously) + * Update deployment devportal visibility + * @param apiId **API ID** consisting of the **UUID** of the API. (required) + * @param deploymentId Base64 URL encoded value of the name of an environment (required) + * @param apIRevisionDeploymentDTO Deployment object that needs to be updated (optional) + * @param _callback The callback to be executed when the API call finishes + * @return The request call + * @throws ApiException If fail to process the API call, e.g. serializing the request body object + * @http.response.details + + + + +
Status Code Description Response Headers
200 Created. Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. -
404 Not Found. The specified resource does not exist. -
+ */ + public okhttp3.Call updateAPIDeploymentAsync(String apiId, String deploymentId, APIRevisionDeploymentDTO apIRevisionDeploymentDTO, final ApiCallback _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAPIDeploymentValidateBeforeCall(apiId, deploymentId, apIRevisionDeploymentDTO, _callback); + Type localVarReturnType = new TypeToken(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AwsLambdaIndividualApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AwsLambdaIndividualApi.java index 9060de53ce..5832f6b658 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AwsLambdaIndividualApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/AwsLambdaIndividualApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java index ca54094c50..c116a74b63 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ClientCertificatesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/CommentsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/CommentsApi.java index 2bdc4e45ed..9aedc2c50d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/CommentsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/CommentsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -72,7 +72,9 @@ public void setApiClient(ApiClient apiClient) { 201 Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public okhttp3.Call addCommentToAPICall(String apiId, PostRequestBodyDTO postRequestBodyDTO, String replyTo, final ApiCallback _callback) throws ApiException { @@ -142,7 +144,9 @@ private okhttp3.Call addCommentToAPIValidateBeforeCall(String apiId, PostRequest 201 Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public CommentDTO addCommentToAPI(String apiId, PostRequestBodyDTO postRequestBodyDTO, String replyTo) throws ApiException { @@ -164,7 +168,9 @@ public CommentDTO addCommentToAPI(String apiId, PostRequestBodyDTO postRequestBo 201 Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public ApiResponse addCommentToAPIWithHttpInfo(String apiId, PostRequestBodyDTO postRequestBodyDTO, String replyTo) throws ApiException { @@ -188,7 +194,9 @@ public ApiResponse addCommentToAPIWithHttpInfo(String apiId, PostReq 201 Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public okhttp3.Call addCommentToAPIAsync(String apiId, PostRequestBodyDTO postRequestBodyDTO, String replyTo, final ApiCallback _callback) throws ApiException { @@ -211,7 +219,10 @@ public okhttp3.Call addCommentToAPIAsync(String apiId, PostRequestBodyDTO postRe Status Code Description Response Headers 200 OK. Resource successfully deleted. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - + 405 MethodNotAllowed. Request method is known by the server but is not supported by the target resource. - + 500 Internal Server Error. - */ public okhttp3.Call deleteCommentCall(String commentId, String apiId, String ifMatch, final ApiCallback _callback) throws ApiException { @@ -280,7 +291,10 @@ private okhttp3.Call deleteCommentValidateBeforeCall(String commentId, String ap Status Code Description Response Headers 200 OK. Resource successfully deleted. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - + 405 MethodNotAllowed. Request method is known by the server but is not supported by the target resource. - + 500 Internal Server Error. - */ public void deleteComment(String commentId, String apiId, String ifMatch) throws ApiException { @@ -300,7 +314,10 @@ public void deleteComment(String commentId, String apiId, String ifMatch) throws Status Code Description Response Headers 200 OK. Resource successfully deleted. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - + 405 MethodNotAllowed. Request method is known by the server but is not supported by the target resource. - + 500 Internal Server Error. - */ public ApiResponse deleteCommentWithHttpInfo(String commentId, String apiId, String ifMatch) throws ApiException { @@ -322,7 +339,10 @@ public ApiResponse deleteCommentWithHttpInfo(String commentId, String apiI Status Code Description Response Headers 200 OK. Resource successfully deleted. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - + 405 MethodNotAllowed. Request method is known by the server but is not supported by the target resource. - + 500 Internal Server Error. - */ public okhttp3.Call deleteCommentAsync(String commentId, String apiId, String ifMatch, final ApiCallback _callback) throws ApiException { @@ -345,8 +365,10 @@ public okhttp3.Call deleteCommentAsync(String commentId, String apiId, String if 200 OK. Comment updated. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public okhttp3.Call editCommentOfAPICall(String commentId, String apiId, PatchRequestBodyDTO patchRequestBodyDTO, final ApiCallback _callback) throws ApiException { @@ -418,8 +440,10 @@ private okhttp3.Call editCommentOfAPIValidateBeforeCall(String commentId, String 200 OK. Comment updated. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public CommentDTO editCommentOfAPI(String commentId, String apiId, PatchRequestBodyDTO patchRequestBodyDTO) throws ApiException { @@ -441,8 +465,10 @@ public CommentDTO editCommentOfAPI(String commentId, String apiId, PatchRequestB 200 OK. Comment updated. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public ApiResponse editCommentOfAPIWithHttpInfo(String commentId, String apiId, PatchRequestBodyDTO patchRequestBodyDTO) throws ApiException { @@ -466,8 +492,10 @@ public ApiResponse editCommentOfAPIWithHttpInfo(String commentId, St 200 OK. Comment updated. * ETag - Entity Tag of the response resource. Used by caches, or in conditional request.
* Location - Location to the newly created Comment.
400 Bad Request. Invalid request or validation error. - 401 Unauthorized. The user is not authorized. - + 403 Forbidden. The request must be conditional but no condition has been specified. - 404 Not Found. The specified resource does not exist. - 415 Unsupported Media Type. The entity of the request was not in a supported format. - + 500 Internal Server Error. - */ public okhttp3.Call editCommentOfAPIAsync(String commentId, String apiId, PatchRequestBodyDTO patchRequestBodyDTO, final ApiCallback _callback) throws ApiException { @@ -491,8 +519,8 @@ public okhttp3.Call editCommentOfAPIAsync(String commentId, String apiId, PatchR - - + +
Status Code Description Response Headers
200 OK. Comments list is returned. -
401 Unauthorized. The user is not authorized. -
406 Not Acceptable. The requested media type is not supported. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ public okhttp3.Call getAllCommentsOfAPICall(String apiId, String xWSO2Tenant, Integer limit, Integer offset, Boolean includeCommenterInfo, final ApiCallback _callback) throws ApiException { @@ -569,8 +597,8 @@ private okhttp3.Call getAllCommentsOfAPIValidateBeforeCall(String apiId, String - - + +
Status Code Description Response Headers
200 OK. Comments list is returned. -
401 Unauthorized. The user is not authorized. -
406 Not Acceptable. The requested media type is not supported. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ public CommentListDTO getAllCommentsOfAPI(String apiId, String xWSO2Tenant, Integer limit, Integer offset, Boolean includeCommenterInfo) throws ApiException { @@ -592,8 +620,8 @@ public CommentListDTO getAllCommentsOfAPI(String apiId, String xWSO2Tenant, Inte - - + +
Status Code Description Response Headers
200 OK. Comments list is returned. -
401 Unauthorized. The user is not authorized. -
406 Not Acceptable. The requested media type is not supported. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ public ApiResponse getAllCommentsOfAPIWithHttpInfo(String apiId, String xWSO2Tenant, Integer limit, Integer offset, Boolean includeCommenterInfo) throws ApiException { @@ -617,8 +645,8 @@ public ApiResponse getAllCommentsOfAPIWithHttpInfo(String apiId, - - + +
Status Code Description Response Headers
200 OK. Comments list is returned. -
401 Unauthorized. The user is not authorized. -
406 Not Acceptable. The requested media type is not supported. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
*/ public okhttp3.Call getAllCommentsOfAPIAsync(String apiId, String xWSO2Tenant, Integer limit, Integer offset, Boolean includeCommenterInfo, final ApiCallback _callback) throws ApiException { @@ -644,10 +672,10 @@ public okhttp3.Call getAllCommentsOfAPIAsync(String apiId, String xWSO2Tenant, I - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public okhttp3.Call getCommentOfAPICall(String commentId, String apiId, String xWSO2Tenant, String ifNoneMatch, Boolean includeCommenterInfo, Integer replyLimit, Integer replyOffset, final ApiCallback _callback) throws ApiException { @@ -736,10 +764,10 @@ private okhttp3.Call getCommentOfAPIValidateBeforeCall(String commentId, String - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public CommentDTO getCommentOfAPI(String commentId, String apiId, String xWSO2Tenant, String ifNoneMatch, Boolean includeCommenterInfo, Integer replyLimit, Integer replyOffset) throws ApiException { @@ -763,10 +791,10 @@ public CommentDTO getCommentOfAPI(String commentId, String apiId, String xWSO2Te - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public ApiResponse getCommentOfAPIWithHttpInfo(String commentId, String apiId, String xWSO2Tenant, String ifNoneMatch, Boolean includeCommenterInfo, Integer replyLimit, Integer replyOffset) throws ApiException { @@ -792,10 +820,10 @@ public ApiResponse getCommentOfAPIWithHttpInfo(String commentId, Str - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public okhttp3.Call getCommentOfAPIAsync(String commentId, String apiId, String xWSO2Tenant, String ifNoneMatch, Boolean includeCommenterInfo, Integer replyLimit, Integer replyOffset, final ApiCallback _callback) throws ApiException { @@ -821,10 +849,10 @@ public okhttp3.Call getCommentOfAPIAsync(String commentId, String apiId, String - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public okhttp3.Call getRepliesOfCommentCall(String commentId, String apiId, String xWSO2Tenant, Integer limit, Integer offset, String ifNoneMatch, Boolean includeCommenterInfo, final ApiCallback _callback) throws ApiException { @@ -913,10 +941,10 @@ private okhttp3.Call getRepliesOfCommentValidateBeforeCall(String commentId, Str - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public CommentListDTO getRepliesOfComment(String commentId, String apiId, String xWSO2Tenant, Integer limit, Integer offset, String ifNoneMatch, Boolean includeCommenterInfo) throws ApiException { @@ -940,10 +968,10 @@ public CommentListDTO getRepliesOfComment(String commentId, String apiId, String - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public ApiResponse getRepliesOfCommentWithHttpInfo(String commentId, String apiId, String xWSO2Tenant, Integer limit, Integer offset, String ifNoneMatch, Boolean includeCommenterInfo) throws ApiException { @@ -969,10 +997,10 @@ public ApiResponse getRepliesOfCommentWithHttpInfo(String commen - +
Status Code Description Response Headers
200 OK. Comment returned. * ETag - Entity Tag of the response resource. Used by caches, or in conditional requests.
* Last-Modified - Date and time the resource has been modifed the last time. Used by caches, or in conditional requests.
304 Not Modified. Empty body because the client has already the latest version of the requested resource. -
401 Unauthorized. The user is not authorized. -
404 Not Found. The specified resource does not exist. -
406 Not Acceptable. The requested media type is not supported. -
500 Internal Server Error. -
*/ public okhttp3.Call getRepliesOfCommentAsync(String commentId, String apiId, String xWSO2Tenant, Integer limit, Integer offset, String ifNoneMatch, Boolean includeCommenterInfo, final ApiCallback _callback) throws ApiException { diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentStatusApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentStatusApi.java deleted file mode 100644 index e4d0a4cbed..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentStatusApi.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentStatusListDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.ErrorDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DeploymentStatusApi { - private ApiClient localVarApiClient; - - public DeploymentStatusApi() { - this(Configuration.getDefaultApiClient()); - } - - public DeploymentStatusApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for deploymentsGetStatus - * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deploymentsGetStatusCall(String apiId, final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/apis/{apiId}/deployments" - .replaceAll("\\{" + "apiId" + "\\}", localVarApiClient.escapeString(apiId.toString())); - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deploymentsGetStatusValidateBeforeCall(String apiId, final ApiCallback _callback) throws ApiException { - - // verify the required parameter 'apiId' is set - if (apiId == null) { - throw new ApiException("Missing the required parameter 'apiId' when calling deploymentsGetStatus(Async)"); - } - - - okhttp3.Call localVarCall = deploymentsGetStatusCall(apiId, _callback); - return localVarCall; - - } - - /** - * Retrieve Deployment Status Details - * This operation can be used to retrieve the status of deployments in cloud clusters. With that you can get the status of the deployed APIs in cloud environments. - * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @return DeploymentStatusListDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public DeploymentStatusListDTO deploymentsGetStatus(String apiId) throws ApiException { - ApiResponse localVarResp = deploymentsGetStatusWithHttpInfo(apiId); - return localVarResp.getData(); - } - - /** - * Retrieve Deployment Status Details - * This operation can be used to retrieve the status of deployments in cloud clusters. With that you can get the status of the deployed APIs in cloud environments. - * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @return ApiResponse<DeploymentStatusListDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public ApiResponse deploymentsGetStatusWithHttpInfo(String apiId) throws ApiException { - okhttp3.Call localVarCall = deploymentsGetStatusValidateBeforeCall(apiId, null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve Deployment Status Details (asynchronously) - * This operation can be used to retrieve the status of deployments in cloud clusters. With that you can get the status of the deployed APIs in cloud environments. - * @param apiId **API ID** consisting of the **UUID** of the API. (required) - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deploymentsGetStatusAsync(String apiId, final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deploymentsGetStatusValidateBeforeCall(apiId, _callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentsApi.java deleted file mode 100644 index e4a4b9ce1c..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/DeploymentsApi.java +++ /dev/null @@ -1,171 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentListDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.ErrorDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class DeploymentsApi { - private ApiClient localVarApiClient; - - public DeploymentsApi() { - this(Configuration.getDefaultApiClient()); - } - - public DeploymentsApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for deploymentsGet - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deploymentsGetCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/deployments"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call deploymentsGetValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = deploymentsGetCall(_callback); - return localVarCall; - - } - - /** - * Retrieve Deployment Environments Details - * This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. With that you can deploy an API to selected cloud environments. - * @return DeploymentListDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public DeploymentListDTO deploymentsGet() throws ApiException { - ApiResponse localVarResp = deploymentsGetWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Retrieve Deployment Environments Details - * This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. With that you can deploy an API to selected cloud environments. - * @return ApiResponse<DeploymentListDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public ApiResponse deploymentsGetWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = deploymentsGetValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Retrieve Deployment Environments Details (asynchronously) - * This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. With that you can deploy an API to selected cloud environments. - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - - - - -
Status Code Description Response Headers
200 OK. Successful response with the list of deployment environments information in the body. * Content-Type - The content type of the body.
400 Bad Request. Invalid request or validation error. -
404 Not Found. The specified resource does not exist. -
500 Internal Server Error. -
- */ - public okhttp3.Call deploymentsGetAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = deploymentsGetValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/EndpointCertificatesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/EndpointCertificatesApi.java index 344b212345..cf2b25b71d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/EndpointCertificatesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/EndpointCertificatesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ExternalStoresApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ExternalStoresApi.java index 7cb7e5a6c1..de7ebead47 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ExternalStoresApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ExternalStoresApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPoliciesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPoliciesApi.java index 56f03fd48a..6372b1f6af 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPoliciesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPoliciesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPolicyApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPolicyApi.java index 9382f14231..fcbf06dde4 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPolicyApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GlobalMediationPolicyApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlPoliciesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlPoliciesApi.java index a0e16d7baa..010af843cc 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlPoliciesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlPoliciesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaApi.java index 9eef94621b..a8f9e9f9fc 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaIndividualApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaIndividualApi.java index 7c17066e38..5b398b8f29 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaIndividualApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/GraphQlSchemaIndividualApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ImportExportApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ImportExportApi.java index b07bc5ffcb..7af7dc1640 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ImportExportApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ImportExportApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/KeyManagersCollectionApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/KeyManagersCollectionApi.java index bb0a170bae..d476fee619 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/KeyManagersCollectionApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/KeyManagersCollectionApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/LabelCollectionApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/LabelCollectionApi.java deleted file mode 100644 index 2643a5603d..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/LabelCollectionApi.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1; - -import org.wso2.am.integration.clients.publisher.api.ApiCallback; -import org.wso2.am.integration.clients.publisher.api.ApiClient; -import org.wso2.am.integration.clients.publisher.api.ApiException; -import org.wso2.am.integration.clients.publisher.api.ApiResponse; -import org.wso2.am.integration.clients.publisher.api.Configuration; -import org.wso2.am.integration.clients.publisher.api.Pair; -import org.wso2.am.integration.clients.publisher.api.ProgressRequestBody; -import org.wso2.am.integration.clients.publisher.api.ProgressResponseBody; - -import com.google.gson.reflect.TypeToken; - -import java.io.IOException; - - -import org.wso2.am.integration.clients.publisher.api.v1.dto.LabelListDTO; - -import java.lang.reflect.Type; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class LabelCollectionApi { - private ApiClient localVarApiClient; - - public LabelCollectionApi() { - this(Configuration.getDefaultApiClient()); - } - - public LabelCollectionApi(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - public ApiClient getApiClient() { - return localVarApiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.localVarApiClient = apiClient; - } - - /** - * Build call for getLabels - * @param _callback Callback for upload/download progress - * @return Call to execute - * @throws ApiException If fail to serialize the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 OK. Labels returned -
- */ - public okhttp3.Call getLabelsCall(final ApiCallback _callback) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/labels"; - - List localVarQueryParams = new ArrayList(); - List localVarCollectionQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarCookieParams = new HashMap(); - Map localVarFormParams = new HashMap(); - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); - if (localVarAccept != null) { - localVarHeaderParams.put("Accept", localVarAccept); - } - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); - localVarHeaderParams.put("Content-Type", localVarContentType); - - String[] localVarAuthNames = new String[] { "OAuth2Security" }; - return localVarApiClient.buildCall(localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); - } - - @SuppressWarnings("rawtypes") - private okhttp3.Call getLabelsValidateBeforeCall(final ApiCallback _callback) throws ApiException { - - - okhttp3.Call localVarCall = getLabelsCall(_callback); - return localVarCall; - - } - - /** - * Get all Registered Labels - * Get all registered Labels - * @return LabelListDTO - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 OK. Labels returned -
- */ - public LabelListDTO getLabels() throws ApiException { - ApiResponse localVarResp = getLabelsWithHttpInfo(); - return localVarResp.getData(); - } - - /** - * Get all Registered Labels - * Get all registered Labels - * @return ApiResponse<LabelListDTO> - * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body - * @http.response.details - - - -
Status Code Description Response Headers
200 OK. Labels returned -
- */ - public ApiResponse getLabelsWithHttpInfo() throws ApiException { - okhttp3.Call localVarCall = getLabelsValidateBeforeCall(null); - Type localVarReturnType = new TypeToken(){}.getType(); - return localVarApiClient.execute(localVarCall, localVarReturnType); - } - - /** - * Get all Registered Labels (asynchronously) - * Get all registered Labels - * @param _callback The callback to be executed when the API call finishes - * @return The request call - * @throws ApiException If fail to process the API call, e.g. serializing the request body object - * @http.response.details - - - -
Status Code Description Response Headers
200 OK. Labels returned -
- */ - public okhttp3.Call getLabelsAsync(final ApiCallback _callback) throws ApiException { - - okhttp3.Call localVarCall = getLabelsValidateBeforeCall(_callback); - Type localVarReturnType = new TypeToken(){}.getType(); - localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); - return localVarCall; - } -} diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/RolesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/RolesApi.java index 4d6586244b..a95975afd0 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/RolesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/RolesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ScopesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ScopesApi.java index 191eee5fb9..9b7a6ef272 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ScopesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ScopesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SettingsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SettingsApi.java index 61857f2b92..9c5bde296f 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SettingsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SettingsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriberApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriberApi.java index e55c79f0d1..aac37ba480 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriberApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriberApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriptionsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriptionsApi.java index 453ba6205d..a8fa469f05 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriptionsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/SubscriptionsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/TenantsApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/TenantsApi.java index 0c8433b445..452756d6fb 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/TenantsApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/TenantsApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ThrottlingPoliciesApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ThrottlingPoliciesApi.java index cef5962acd..6e4e54f37c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ThrottlingPoliciesApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ThrottlingPoliciesApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/UnifiedSearchApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/UnifiedSearchApi.java index 7243e05eba..cc2f6045f2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/UnifiedSearchApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/UnifiedSearchApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ValidationApi.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ValidationApi.java index a5fa363218..8ca75e308d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ValidationApi.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/ValidationApi.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -511,7 +511,7 @@ private okhttp3.Call validateGraphQLSchemaValidateBeforeCall(File file, final Ap } /** - * Validate GraphQL API Definition and Retrieve a Summary + * Validate a GraphQL SDL * This operation can be used to validate a graphQL definition and retrieve a summary. * @param file Definition to upload as a file (required) * @return GraphQLValidationResponseDTO @@ -530,7 +530,7 @@ public GraphQLValidationResponseDTO validateGraphQLSchema(File file) throws ApiE } /** - * Validate GraphQL API Definition and Retrieve a Summary + * Validate a GraphQL SDL * This operation can be used to validate a graphQL definition and retrieve a summary. * @param file Definition to upload as a file (required) * @return ApiResponse<GraphQLValidationResponseDTO> @@ -550,7 +550,7 @@ public ApiResponse validateGraphQLSchemaWithHttpIn } /** - * Validate GraphQL API Definition and Retrieve a Summary (asynchronously) + * Validate a GraphQL SDL (asynchronously) * This operation can be used to validate a graphQL definition and retrieve a summary. * @param file Definition to upload as a file (required) * @param _callback The callback to be executed when the API call finishes @@ -576,6 +576,7 @@ public okhttp3.Call validateGraphQLSchemaAsync(File file, final ApiCallback 404 Not Found. The specified resource does not exist. - */ - public okhttp3.Call validateOpenAPIDefinitionCall(Boolean returnContent, String url, File file, final ApiCallback _callback) throws ApiException { + public okhttp3.Call validateOpenAPIDefinitionCall(Boolean returnContent, String url, File file, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { Object localVarPostBody = null; // create path and map variables @@ -610,6 +611,10 @@ public okhttp3.Call validateOpenAPIDefinitionCall(Boolean returnContent, String localVarFormParams.put("file", file); } + if (inlineAPIDefinition != null) { + localVarFormParams.put("inlineAPIDefinition", inlineAPIDefinition); + } + final String[] localVarAccepts = { "application/json" }; @@ -629,10 +634,10 @@ public okhttp3.Call validateOpenAPIDefinitionCall(Boolean returnContent, String } @SuppressWarnings("rawtypes") - private okhttp3.Call validateOpenAPIDefinitionValidateBeforeCall(Boolean returnContent, String url, File file, final ApiCallback _callback) throws ApiException { + private okhttp3.Call validateOpenAPIDefinitionValidateBeforeCall(Boolean returnContent, String url, File file, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = validateOpenAPIDefinitionCall(returnContent, url, file, _callback); + okhttp3.Call localVarCall = validateOpenAPIDefinitionCall(returnContent, url, file, inlineAPIDefinition, _callback); return localVarCall; } @@ -643,6 +648,7 @@ private okhttp3.Call validateOpenAPIDefinitionValidateBeforeCall(Boolean returnC * @param returnContent Specify whether to return the full content of the OpenAPI definition in the response. This is only applicable when using url based validation (optional, default to false) * @param url OpenAPI definition url (optional) * @param file OpenAPI definition as a file (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @return OpenAPIDefinitionValidationResponseDTO * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -653,8 +659,8 @@ private okhttp3.Call validateOpenAPIDefinitionValidateBeforeCall(Boolean returnC 404 Not Found. The specified resource does not exist. - */ - public OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(Boolean returnContent, String url, File file) throws ApiException { - ApiResponse localVarResp = validateOpenAPIDefinitionWithHttpInfo(returnContent, url, file); + public OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(Boolean returnContent, String url, File file, String inlineAPIDefinition) throws ApiException { + ApiResponse localVarResp = validateOpenAPIDefinitionWithHttpInfo(returnContent, url, file, inlineAPIDefinition); return localVarResp.getData(); } @@ -664,6 +670,7 @@ public OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(Boolean * @param returnContent Specify whether to return the full content of the OpenAPI definition in the response. This is only applicable when using url based validation (optional, default to false) * @param url OpenAPI definition url (optional) * @param file OpenAPI definition as a file (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @return ApiResponse<OpenAPIDefinitionValidationResponseDTO> * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body * @http.response.details @@ -674,8 +681,8 @@ public OpenAPIDefinitionValidationResponseDTO validateOpenAPIDefinition(Boolean 404 Not Found. The specified resource does not exist. - */ - public ApiResponse validateOpenAPIDefinitionWithHttpInfo(Boolean returnContent, String url, File file) throws ApiException { - okhttp3.Call localVarCall = validateOpenAPIDefinitionValidateBeforeCall(returnContent, url, file, null); + public ApiResponse validateOpenAPIDefinitionWithHttpInfo(Boolean returnContent, String url, File file, String inlineAPIDefinition) throws ApiException { + okhttp3.Call localVarCall = validateOpenAPIDefinitionValidateBeforeCall(returnContent, url, file, inlineAPIDefinition, null); Type localVarReturnType = new TypeToken(){}.getType(); return localVarApiClient.execute(localVarCall, localVarReturnType); } @@ -686,6 +693,7 @@ public ApiResponse validateOpenAPIDefini * @param returnContent Specify whether to return the full content of the OpenAPI definition in the response. This is only applicable when using url based validation (optional, default to false) * @param url OpenAPI definition url (optional) * @param file OpenAPI definition as a file (optional) + * @param inlineAPIDefinition Inline content of the OpenAPI definition (optional) * @param _callback The callback to be executed when the API call finishes * @return The request call * @throws ApiException If fail to process the API call, e.g. serializing the request body object @@ -697,9 +705,9 @@ public ApiResponse validateOpenAPIDefini 404 Not Found. The specified resource does not exist. - */ - public okhttp3.Call validateOpenAPIDefinitionAsync(Boolean returnContent, String url, File file, final ApiCallback _callback) throws ApiException { + public okhttp3.Call validateOpenAPIDefinitionAsync(Boolean returnContent, String url, File file, String inlineAPIDefinition, final ApiCallback _callback) throws ApiException { - okhttp3.Call localVarCall = validateOpenAPIDefinitionValidateBeforeCall(returnContent, url, file, _callback); + okhttp3.Call localVarCall = validateOpenAPIDefinitionValidateBeforeCall(returnContent, url, file, inlineAPIDefinition, _callback); Type localVarReturnType = new TypeToken(){}.getType(); localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); return localVarCall; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIAdditionalPropertiesDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIAdditionalPropertiesDTO.java index 5b10c02702..738a45d2a3 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIAdditionalPropertiesDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIAdditionalPropertiesDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIBusinessInformationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIBusinessInformationDTO.java index 52440026a9..8026e49297 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIBusinessInformationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIBusinessInformationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryDTO.java index 6c3243168a..2900d0e5a4 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryListDTO.java index 0aaaab93a6..11f3e988e0 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICategoryListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICorsConfigurationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICorsConfigurationDTO.java index ca7c5d5291..4e94686808 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICorsConfigurationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APICorsConfigurationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIDTO.java index b7633d7a14..d0cac70913 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -28,14 +28,13 @@ import org.wso2.am.integration.clients.publisher.api.v1.dto.APIAdditionalPropertiesDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIBusinessInformationDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APICorsConfigurationDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIEndpointSecurityDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIMaxTpsDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIMonetizationInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIOperationsDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIScopeDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIServiceInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIThreatProtectionPoliciesDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentEnvironmentsDTO; +import org.wso2.am.integration.clients.publisher.api.v1.dto.AdvertiseInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.MediationPolicyDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.WSDLInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.WebsubSubscriptionConfigurationDTO; @@ -275,22 +274,10 @@ public VisibilityEnum read(final JsonReader jsonReader) throws IOException { @SerializedName(SERIALIZED_NAME_VISIBLE_TENANTS) private List visibleTenants = null; - public static final String SERIALIZED_NAME_ENDPOINT_SECURITY = "endpointSecurity"; - @SerializedName(SERIALIZED_NAME_ENDPOINT_SECURITY) - private APIEndpointSecurityDTO endpointSecurity; - public static final String SERIALIZED_NAME_GATEWAY_ENVIRONMENTS = "gatewayEnvironments"; @SerializedName(SERIALIZED_NAME_GATEWAY_ENVIRONMENTS) private List gatewayEnvironments = null; - public static final String SERIALIZED_NAME_DEPLOYMENT_ENVIRONMENTS = "deploymentEnvironments"; - @SerializedName(SERIALIZED_NAME_DEPLOYMENT_ENVIRONMENTS) - private List deploymentEnvironments = null; - - public static final String SERIALIZED_NAME_LABELS = "labels"; - @SerializedName(SERIALIZED_NAME_LABELS) - private List labels = null; - public static final String SERIALIZED_NAME_MEDIATION_POLICIES = "mediationPolicies"; @SerializedName(SERIALIZED_NAME_MEDIATION_POLICIES) private List mediationPolicies = null; @@ -417,7 +404,7 @@ public AccessControlEnum read(final JsonReader jsonReader) throws IOException { public static final String SERIALIZED_NAME_BUSINESS_INFORMATION = "businessInformation"; @SerializedName(SERIALIZED_NAME_BUSINESS_INFORMATION) - private APIBusinessInformationDTO businessInformation; + private APIBusinessInformationDTO businessInformation = null; public static final String SERIALIZED_NAME_CORS_CONFIGURATION = "corsConfiguration"; @SerializedName(SERIALIZED_NAME_CORS_CONFIGURATION) @@ -518,6 +505,10 @@ public EndpointImplementationTypeEnum read(final JsonReader jsonReader) throws I @SerializedName(SERIALIZED_NAME_SERVICE_INFO) private APIServiceInfoDTO serviceInfo; + public static final String SERIALIZED_NAME_ADVERTISE_INFO = "advertiseInfo"; + @SerializedName(SERIALIZED_NAME_ADVERTISE_INFO) + private AdvertiseInfoDTO advertiseInfo; + public APIDTO id(String id) { @@ -1229,29 +1220,6 @@ public void setVisibleTenants(List visibleTenants) { } - public APIDTO endpointSecurity(APIEndpointSecurityDTO endpointSecurity) { - - this.endpointSecurity = endpointSecurity; - return this; - } - - /** - * Get endpointSecurity - * @return endpointSecurity - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public APIEndpointSecurityDTO getEndpointSecurity() { - return endpointSecurity; - } - - - public void setEndpointSecurity(APIEndpointSecurityDTO endpointSecurity) { - this.endpointSecurity = endpointSecurity; - } - - public APIDTO gatewayEnvironments(List gatewayEnvironments) { this.gatewayEnvironments = gatewayEnvironments; @@ -1275,52 +1243,6 @@ public void setGatewayEnvironments(List gatewayEnvironments) { } - public APIDTO deploymentEnvironments(List deploymentEnvironments) { - - this.deploymentEnvironments = deploymentEnvironments; - return this; - } - - /** - * List of selected deployment environments and clusters - * @return deploymentEnvironments - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "List of selected deployment environments and clusters ") - - public List getDeploymentEnvironments() { - return deploymentEnvironments; - } - - - public void setDeploymentEnvironments(List deploymentEnvironments) { - this.deploymentEnvironments = deploymentEnvironments; - } - - - public APIDTO labels(List labels) { - - this.labels = labels; - return this; - } - - /** - * Labels of micro-gateway environments attached to the API. - * @return labels - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "[]", value = "Labels of micro-gateway environments attached to the API. ") - - public List getLabels() { - return labels; - } - - - public void setLabels(List labels) { - this.labels = labels; - } - - public APIDTO mediationPolicies(List mediationPolicies) { this.mediationPolicies = mediationPolicies; @@ -1804,6 +1726,29 @@ public void setServiceInfo(APIServiceInfoDTO serviceInfo) { } + public APIDTO advertiseInfo(AdvertiseInfoDTO advertiseInfo) { + + this.advertiseInfo = advertiseInfo; + return this; + } + + /** + * Get advertiseInfo + * @return advertiseInfo + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + + public AdvertiseInfoDTO getAdvertiseInfo() { + return advertiseInfo; + } + + + public void setAdvertiseInfo(AdvertiseInfoDTO advertiseInfo) { + this.advertiseInfo = advertiseInfo; + } + + @Override public boolean equals(Object o) { if (this == o) { @@ -1844,10 +1789,7 @@ public boolean equals(Object o) { Objects.equals(this.visibility, API.visibility) && Objects.equals(this.visibleRoles, API.visibleRoles) && Objects.equals(this.visibleTenants, API.visibleTenants) && - Objects.equals(this.endpointSecurity, API.endpointSecurity) && Objects.equals(this.gatewayEnvironments, API.gatewayEnvironments) && - Objects.equals(this.deploymentEnvironments, API.deploymentEnvironments) && - Objects.equals(this.labels, API.labels) && Objects.equals(this.mediationPolicies, API.mediationPolicies) && Objects.equals(this.subscriptionAvailability, API.subscriptionAvailability) && Objects.equals(this.subscriptionAvailableTenants, API.subscriptionAvailableTenants) && @@ -1868,12 +1810,13 @@ public boolean equals(Object o) { Objects.equals(this.threatProtectionPolicies, API.threatProtectionPolicies) && Objects.equals(this.categories, API.categories) && Objects.equals(this.keyManagers, API.keyManagers) && - Objects.equals(this.serviceInfo, API.serviceInfo); + Objects.equals(this.serviceInfo, API.serviceInfo) && + Objects.equals(this.advertiseInfo, API.advertiseInfo); } @Override public int hashCode() { - return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, testKey, responseCachingEnabled, cacheTimeout, destinationStatsEnabled, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableStore, type, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, endpointSecurity, gatewayEnvironments, deploymentEnvironments, labels, mediationPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo); + return Objects.hash(id, name, description, context, version, provider, lifeCycleStatus, wsdlInfo, wsdlUrl, testKey, responseCachingEnabled, cacheTimeout, destinationStatsEnabled, hasThumbnail, isDefaultVersion, isRevision, revisionedApiId, revisionId, enableSchemaValidation, enableStore, type, transport, tags, policies, apiThrottlingPolicy, authorizationHeader, securityScheme, maxTps, visibility, visibleRoles, visibleTenants, gatewayEnvironments, mediationPolicies, subscriptionAvailability, subscriptionAvailableTenants, additionalProperties, monetization, accessControl, accessControlRoles, businessInformation, corsConfiguration, websubSubscriptionConfiguration, workflowStatus, createdTime, lastUpdatedTime, endpointConfig, endpointImplementationType, scopes, operations, threatProtectionPolicies, categories, keyManagers, serviceInfo, advertiseInfo); } @@ -1912,10 +1855,7 @@ public String toString() { sb.append(" visibility: ").append(toIndentedString(visibility)).append("\n"); sb.append(" visibleRoles: ").append(toIndentedString(visibleRoles)).append("\n"); sb.append(" visibleTenants: ").append(toIndentedString(visibleTenants)).append("\n"); - sb.append(" endpointSecurity: ").append(toIndentedString(endpointSecurity)).append("\n"); sb.append(" gatewayEnvironments: ").append(toIndentedString(gatewayEnvironments)).append("\n"); - sb.append(" deploymentEnvironments: ").append(toIndentedString(deploymentEnvironments)).append("\n"); - sb.append(" labels: ").append(toIndentedString(labels)).append("\n"); sb.append(" mediationPolicies: ").append(toIndentedString(mediationPolicies)).append("\n"); sb.append(" subscriptionAvailability: ").append(toIndentedString(subscriptionAvailability)).append("\n"); sb.append(" subscriptionAvailableTenants: ").append(toIndentedString(subscriptionAvailableTenants)).append("\n"); @@ -1937,6 +1877,7 @@ public String toString() { sb.append(" categories: ").append(toIndentedString(categories)).append("\n"); sb.append(" keyManagers: ").append(toIndentedString(keyManagers)).append("\n"); sb.append(" serviceInfo: ").append(toIndentedString(serviceInfo)).append("\n"); + sb.append(" advertiseInfo: ").append(toIndentedString(advertiseInfo)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIEndpointSecurityDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIEndpointSecurityDTO.java deleted file mode 100644 index 9985290594..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIEndpointSecurityDTO.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* APIEndpointSecurityDTO -*/ - -public class APIEndpointSecurityDTO { - /** -* Accepts one of the following, basic or digest. -*/ - @JsonAdapter(TypeEnum.Adapter.class) -public enum TypeEnum { - BASIC("BASIC"), - - DIGEST("DIGEST"); - -private String value; - -TypeEnum(String value) { -this.value = value; -} - -public String getValue() { -return value; -} - -@Override -public String toString() { -return String.valueOf(value); -} - -public static TypeEnum fromValue(String value) { - for (TypeEnum b : TypeEnum.values()) { - if (b.name().equals(value)) { - return b; - } -} - throw new IllegalArgumentException("Unexpected value '" + value + "'"); -} - - public static class Adapter extends TypeAdapter { - @Override - public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { - jsonWriter.value(enumeration.getValue()); - } - - @Override - public TypeEnum read(final JsonReader jsonReader) throws IOException { - String value = jsonReader.nextString(); - return TypeEnum.fromValue(value); - } - } -} - - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private TypeEnum type; - - public static final String SERIALIZED_NAME_USERNAME = "username"; - @SerializedName(SERIALIZED_NAME_USERNAME) - private String username; - - public static final String SERIALIZED_NAME_PASSWORD = "password"; - @SerializedName(SERIALIZED_NAME_PASSWORD) - private String password; - - - public APIEndpointSecurityDTO type(TypeEnum type) { - - this.type = type; - return this; - } - - /** - * Accepts one of the following, basic or digest. - * @return type - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "BASIC", value = "Accepts one of the following, basic or digest.") - - public TypeEnum getType() { - return type; - } - - - public void setType(TypeEnum type) { - this.type = type; - } - - - public APIEndpointSecurityDTO username(String username) { - - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "admin", value = "") - - public String getUsername() { - return username; - } - - - public void setUsername(String username) { - this.username = username; - } - - - public APIEndpointSecurityDTO password(String password) { - - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "password", value = "") - - public String getPassword() { - return password; - } - - - public void setPassword(String password) { - this.password = password; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - APIEndpointSecurityDTO apIEndpointSecurity = (APIEndpointSecurityDTO) o; - return Objects.equals(this.type, apIEndpointSecurity.type) && - Objects.equals(this.username, apIEndpointSecurity.username) && - Objects.equals(this.password, apIEndpointSecurity.password); - } - - @Override - public int hashCode() { - return Objects.hash(type, username, password); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class APIEndpointSecurityDTO {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreDTO.java index fb83470a08..2f48199de5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreListDTO.java index 2d44cf58dc..787d0ef72e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIExternalStoreListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoDTO.java index 034df81658..19f3d752b9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIInfoWebsubSubscriptionConfigurationDTO; import com.fasterxml.jackson.annotation.JsonCreator; /** * APIInfoDTO @@ -76,9 +75,13 @@ public class APIInfoDTO { @SerializedName(SERIALIZED_NAME_SECURITY_SCHEME) private List securityScheme = null; - public static final String SERIALIZED_NAME_WEBSUB_SUBSCRIPTION_CONFIGURATION = "websubSubscriptionConfiguration"; - @SerializedName(SERIALIZED_NAME_WEBSUB_SUBSCRIPTION_CONFIGURATION) - private APIInfoWebsubSubscriptionConfigurationDTO websubSubscriptionConfiguration; + public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime"; + @SerializedName(SERIALIZED_NAME_CREATED_TIME) + private String createdTime; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "updatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + private String updatedTime; public APIInfoDTO id(String id) { @@ -334,26 +337,49 @@ public void setSecurityScheme(List securityScheme) { } - public APIInfoDTO websubSubscriptionConfiguration(APIInfoWebsubSubscriptionConfigurationDTO websubSubscriptionConfiguration) { + public APIInfoDTO createdTime(String createdTime) { - this.websubSubscriptionConfiguration = websubSubscriptionConfiguration; + this.createdTime = createdTime; return this; } /** - * Get websubSubscriptionConfiguration - * @return websubSubscriptionConfiguration + * Get createdTime + * @return createdTime **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "2021-02-11 09:57:25", value = "") + + public String getCreatedTime() { + return createdTime; + } + + + public void setCreatedTime(String createdTime) { + this.createdTime = createdTime; + } + + + public APIInfoDTO updatedTime(String updatedTime) { + + this.updatedTime = updatedTime; + return this; + } + + /** + * Get updatedTime + * @return updatedTime + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "2021-02-11 09:57:25", value = "") - public APIInfoWebsubSubscriptionConfigurationDTO getWebsubSubscriptionConfiguration() { - return websubSubscriptionConfiguration; + public String getUpdatedTime() { + return updatedTime; } - public void setWebsubSubscriptionConfiguration(APIInfoWebsubSubscriptionConfigurationDTO websubSubscriptionConfiguration) { - this.websubSubscriptionConfiguration = websubSubscriptionConfiguration; + public void setUpdatedTime(String updatedTime) { + this.updatedTime = updatedTime; } @@ -377,12 +403,13 @@ public boolean equals(Object o) { Objects.equals(this.workflowStatus, apIInfo.workflowStatus) && Objects.equals(this.hasThumbnail, apIInfo.hasThumbnail) && Objects.equals(this.securityScheme, apIInfo.securityScheme) && - Objects.equals(this.websubSubscriptionConfiguration, apIInfo.websubSubscriptionConfiguration); + Objects.equals(this.createdTime, apIInfo.createdTime) && + Objects.equals(this.updatedTime, apIInfo.updatedTime); } @Override public int hashCode() { - return Objects.hash(id, name, description, context, version, provider, type, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, websubSubscriptionConfiguration); + return Objects.hash(id, name, description, context, version, provider, type, lifeCycleStatus, workflowStatus, hasThumbnail, securityScheme, createdTime, updatedTime); } @@ -401,7 +428,8 @@ public String toString() { sb.append(" workflowStatus: ").append(toIndentedString(workflowStatus)).append("\n"); sb.append(" hasThumbnail: ").append(toIndentedString(hasThumbnail)).append("\n"); sb.append(" securityScheme: ").append(toIndentedString(securityScheme)).append("\n"); - sb.append(" websubSubscriptionConfiguration: ").append(toIndentedString(websubSubscriptionConfiguration)).append("\n"); + sb.append(" createdTime: ").append(toIndentedString(createdTime)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoWebsubSubscriptionConfigurationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoWebsubSubscriptionConfigurationDTO.java deleted file mode 100644 index f8ef3fad1b..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIInfoWebsubSubscriptionConfigurationDTO.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* APIInfoWebsubSubscriptionConfigurationDTO -*/ - -public class APIInfoWebsubSubscriptionConfigurationDTO { - public static final String SERIALIZED_NAME_SECRET = "secret"; - @SerializedName(SERIALIZED_NAME_SECRET) - private String secret; - - public static final String SERIALIZED_NAME_SIGNING_ALGORITHM = "signingAlgorithm"; - @SerializedName(SERIALIZED_NAME_SIGNING_ALGORITHM) - private String signingAlgorithm; - - public static final String SERIALIZED_NAME_SIGNATURE_HEADER = "signatureHeader"; - @SerializedName(SERIALIZED_NAME_SIGNATURE_HEADER) - private String signatureHeader; - - - public APIInfoWebsubSubscriptionConfigurationDTO secret(String secret) { - - this.secret = secret; - return this; - } - - /** - * Get secret - * @return secret - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSecret() { - return secret; - } - - - public void setSecret(String secret) { - this.secret = secret; - } - - - public APIInfoWebsubSubscriptionConfigurationDTO signingAlgorithm(String signingAlgorithm) { - - this.signingAlgorithm = signingAlgorithm; - return this; - } - - /** - * Get signingAlgorithm - * @return signingAlgorithm - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSigningAlgorithm() { - return signingAlgorithm; - } - - - public void setSigningAlgorithm(String signingAlgorithm) { - this.signingAlgorithm = signingAlgorithm; - } - - - public APIInfoWebsubSubscriptionConfigurationDTO signatureHeader(String signatureHeader) { - - this.signatureHeader = signatureHeader; - return this; - } - - /** - * Get signatureHeader - * @return signatureHeader - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public String getSignatureHeader() { - return signatureHeader; - } - - - public void setSignatureHeader(String signatureHeader) { - this.signatureHeader = signatureHeader; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - APIInfoWebsubSubscriptionConfigurationDTO apIInfoWebsubSubscriptionConfiguration = (APIInfoWebsubSubscriptionConfigurationDTO) o; - return Objects.equals(this.secret, apIInfoWebsubSubscriptionConfiguration.secret) && - Objects.equals(this.signingAlgorithm, apIInfoWebsubSubscriptionConfiguration.signingAlgorithm) && - Objects.equals(this.signatureHeader, apIInfoWebsubSubscriptionConfiguration.signatureHeader); - } - - @Override - public int hashCode() { - return Objects.hash(secret, signingAlgorithm, signatureHeader); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class APIInfoWebsubSubscriptionConfigurationDTO {\n"); - sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); - sb.append(" signingAlgorithm: ").append(toIndentedString(signingAlgorithm)).append("\n"); - sb.append(" signatureHeader: ").append(toIndentedString(signatureHeader)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIKeyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIKeyDTO.java index 4091fa2a39..0039457afb 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIKeyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIKeyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListDTO.java index dc1a41d530..40ba6971ca 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListExpandedDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListExpandedDTO.java index 737142eff4..03abb7c3ae 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListExpandedDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIListExpandedDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMaxTpsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMaxTpsDTO.java index 3ffb8bf9f0..ccffdf9def 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMaxTpsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMaxTpsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationInfoDTO.java index 31afa154c0..17f0862826 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationUsageDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationUsageDTO.java index be83bcb9a1..d65726a8e0 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationUsageDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIMonetizationUsageDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIOperationsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIOperationsDTO.java index 13a83ffa14..8d077ab3be 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIOperationsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIOperationsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductBusinessInformationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductBusinessInformationDTO.java index d2caf78008..bed69a13d9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductBusinessInformationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductBusinessInformationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductDTO.java index de2675b184..6b72914293 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductInfoDTO.java index e40b045aef..3ef1fe0e9d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductListDTO.java index 624f9d596a..945bf443ef 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductOutdatedStatusDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductOutdatedStatusDTO.java index f7d0223ebe..a5c919f821 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductOutdatedStatusDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductOutdatedStatusDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultAllOfDTO.java index 1b17b52d98..05baed411a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultDTO.java index d646c9b15e..eaf05ffeb2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIProductSearchResultDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevenueDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevenueDTO.java index 2ccaf55ab5..2df6fa8178 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevenueDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevenueDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionAPIInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionAPIInfoDTO.java index 9d68442921..8e34165566 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionAPIInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionAPIInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java index 29bba990c8..cc82933926 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -24,6 +24,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; +import java.util.Date; import java.util.List; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIRevisionAPIInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIRevisionDeploymentDTO; @@ -47,7 +48,7 @@ public class APIRevisionDTO { public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime"; @SerializedName(SERIALIZED_NAME_CREATED_TIME) - private String createdTime; + private Date createdTime; public static final String SERIALIZED_NAME_API_INFO = "apiInfo"; @SerializedName(SERIALIZED_NAME_API_INFO) @@ -127,7 +128,7 @@ public void setDescription(String description) { } - public APIRevisionDTO createdTime(String createdTime) { + public APIRevisionDTO createdTime(Date createdTime) { this.createdTime = createdTime; return this; @@ -140,12 +141,12 @@ public APIRevisionDTO createdTime(String createdTime) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public String getCreatedTime() { + public Date getCreatedTime() { return createdTime; } - public void setCreatedTime(String createdTime) { + public void setCreatedTime(Date createdTime) { this.createdTime = createdTime; } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java index 82950d9cde..d5e3ccf3ec 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -23,6 +23,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; +import java.util.Date; import com.fasterxml.jackson.annotation.JsonCreator; /** * APIRevisionDeploymentDTO @@ -47,7 +48,7 @@ public class APIRevisionDeploymentDTO { public static final String SERIALIZED_NAME_DEPLOYED_TIME = "deployedTime"; @SerializedName(SERIALIZED_NAME_DEPLOYED_TIME) - private String deployedTime; + private Date deployedTime; public APIRevisionDeploymentDTO revisionUuid(String revisionUuid) { @@ -142,7 +143,7 @@ public void setDisplayOnDevportal(Boolean displayOnDevportal) { } - public APIRevisionDeploymentDTO deployedTime(String deployedTime) { + public APIRevisionDeploymentDTO deployedTime(Date deployedTime) { this.deployedTime = deployedTime; return this; @@ -155,12 +156,12 @@ public APIRevisionDeploymentDTO deployedTime(String deployedTime) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public String getDeployedTime() { + public Date getDeployedTime() { return deployedTime; } - public void setDeployedTime(String deployedTime) { + public void setDeployedTime(Date deployedTime) { this.deployedTime = deployedTime; } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentListDTO.java index 302622982d..d2a7c1299a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionListDTO.java index d07255d642..6165b75cd1 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIScopeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIScopeDTO.java index bd7216d28c..c6a507aabb 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIScopeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIScopeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultAllOfDTO.java index d79e5be1ed..2f1e9d6256 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultDTO.java index ca7ef97118..4626349c3c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APISearchResultDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIServiceInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIServiceInfoDTO.java index 653ade70e4..d47bb30145 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIServiceInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIServiceInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesDTO.java index fdc5daea26..c321f9feac 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesListDTO.java index bef8bce20a..03b029cad6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIThreatProtectionPoliciesListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AdvertiseInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AdvertiseInfoDTO.java new file mode 100644 index 0000000000..3738875832 --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AdvertiseInfoDTO.java @@ -0,0 +1,157 @@ +/* + * WSO2 API Manager - Publisher API + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * + * The version of the OpenAPI document: v2 + * Contact: architecture@wso2.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.wso2.am.integration.clients.publisher.api.v1.dto; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonCreator; +/** +* AdvertiseInfoDTO +*/ + +public class AdvertiseInfoDTO { + public static final String SERIALIZED_NAME_ADVERTISED = "advertised"; + @SerializedName(SERIALIZED_NAME_ADVERTISED) + private Boolean advertised; + + public static final String SERIALIZED_NAME_ORIGINAL_DEV_PORTAL_URL = "originalDevPortalUrl"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_DEV_PORTAL_URL) + private String originalDevPortalUrl; + + public static final String SERIALIZED_NAME_API_OWNER = "apiOwner"; + @SerializedName(SERIALIZED_NAME_API_OWNER) + private String apiOwner; + + + public AdvertiseInfoDTO advertised(Boolean advertised) { + + this.advertised = advertised; + return this; + } + + /** + * Get advertised + * @return advertised + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "true", value = "") + + public Boolean isAdvertised() { + return advertised; + } + + + public void setAdvertised(Boolean advertised) { + this.advertised = advertised; + } + + + public AdvertiseInfoDTO originalDevPortalUrl(String originalDevPortalUrl) { + + this.originalDevPortalUrl = originalDevPortalUrl; + return this; + } + + /** + * Get originalDevPortalUrl + * @return originalDevPortalUrl + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "https://localhost:9443/devportal", value = "") + + public String getOriginalDevPortalUrl() { + return originalDevPortalUrl; + } + + + public void setOriginalDevPortalUrl(String originalDevPortalUrl) { + this.originalDevPortalUrl = originalDevPortalUrl; + } + + + public AdvertiseInfoDTO apiOwner(String apiOwner) { + + this.apiOwner = apiOwner; + return this; + } + + /** + * Get apiOwner + * @return apiOwner + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "admin", value = "") + + public String getApiOwner() { + return apiOwner; + } + + + public void setApiOwner(String apiOwner) { + this.apiOwner = apiOwner; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AdvertiseInfoDTO advertiseInfo = (AdvertiseInfoDTO) o; + return Objects.equals(this.advertised, advertiseInfo.advertised) && + Objects.equals(this.originalDevPortalUrl, advertiseInfo.originalDevPortalUrl) && + Objects.equals(this.apiOwner, advertiseInfo.apiOwner); + } + + @Override + public int hashCode() { + return Objects.hash(advertised, originalDevPortalUrl, apiOwner); + } + + +@Override +public String toString() { +StringBuilder sb = new StringBuilder(); +sb.append("class AdvertiseInfoDTO {\n"); + sb.append(" advertised: ").append(toIndentedString(advertised)).append("\n"); + sb.append(" originalDevPortalUrl: ").append(toIndentedString(originalDevPortalUrl)).append("\n"); + sb.append(" apiOwner: ").append(toIndentedString(apiOwner)).append("\n"); +sb.append("}"); +return sb.toString(); +} + +/** +* Convert the given object to string with each line indented by 4 spaces +* (except the first line). +*/ +private String toIndentedString(Object o) { +if (o == null) { +return "null"; +} +return o.toString().replace("\n", "\n "); +} + +} + diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigDTO.java deleted file mode 100644 index 2afed5cde3..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertConfigDTO -*/ - -public class AlertConfigDTO { - public static final String SERIALIZED_NAME_CONFIGURATION_ID = "configurationId"; - @SerializedName(SERIALIZED_NAME_CONFIGURATION_ID) - private String configurationId; - - public static final String SERIALIZED_NAME_CONFIGURATION = "configuration"; - @SerializedName(SERIALIZED_NAME_CONFIGURATION) - private Map _configuration = null; - - - public AlertConfigDTO configurationId(String configurationId) { - - this.configurationId = configurationId; - return this; - } - - /** - * The alert config subscription id. - * @return configurationId - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K", value = "The alert config subscription id.") - - public String getConfigurationId() { - return configurationId; - } - - - public void setConfigurationId(String configurationId) { - this.configurationId = configurationId; - } - - - public AlertConfigDTO _configuration(Map _configuration) { - - this._configuration = _configuration; - return this; - } - - /** - * The config parameters. - * @return _configuration - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "{\"apiName\":\"PizzaShackAPI\",\"apiVersion\":\"1.0.0\",\"applicationName\":\"DefaultApplication\",\"requestConunt\":\"12\"}", value = "The config parameters.") - - public Map getConfiguration() { - return _configuration; - } - - - public void setConfiguration(Map _configuration) { - this._configuration = _configuration; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertConfigDTO alertConfig = (AlertConfigDTO) o; - return Objects.equals(this.configurationId, alertConfig.configurationId) && - Objects.equals(this._configuration, alertConfig._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(configurationId, _configuration); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertConfigDTO {\n"); - sb.append(" configurationId: ").append(toIndentedString(configurationId)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigListDTO.java deleted file mode 100644 index 649ba7f9eb..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertConfigListDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertConfigDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertConfigListDTO -*/ - -public class AlertConfigListDTO { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) - private Integer count; - - public static final String SERIALIZED_NAME_LIST = "list"; - @SerializedName(SERIALIZED_NAME_LIST) - private List list = null; - - - public AlertConfigListDTO count(Integer count) { - - this.count = count; - return this; - } - - /** - * Get count - * @return count - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "") - - public Integer getCount() { - return count; - } - - - public void setCount(Integer count) { - this.count = count; - } - - - public AlertConfigListDTO list(List list) { - - this.list = list; - return this; - } - - /** - * Get list - * @return list - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getList() { - return list; - } - - - public void setList(List list) { - this.list = list; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertConfigListDTO alertConfigList = (AlertConfigListDTO) o; - return Objects.equals(this.count, alertConfigList.count) && - Objects.equals(this.list, alertConfigList.list); - } - - @Override - public int hashCode() { - return Objects.hash(count, list); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertConfigListDTO {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" list: ").append(toIndentedString(list)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertDTO.java deleted file mode 100644 index 90f6b73cf2..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertDTO.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertConfigDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertDTO -*/ - -public class AlertDTO { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Integer id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CONFIGURATION = "configuration"; - @SerializedName(SERIALIZED_NAME_CONFIGURATION) - private List _configuration = null; - - - public AlertDTO id(Integer id) { - - this.id = id; - return this; - } - - /** - * The alert Id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "The alert Id") - - public Integer getId() { - return id; - } - - - public void setId(Integer id) { - this.id = id; - } - - - public AlertDTO name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the alert. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "AbnormalRequestsPerMin", value = "The name of the alert.") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public AlertDTO _configuration(List _configuration) { - - this._configuration = _configuration; - return this; - } - - /** - * Get _configuration - * @return _configuration - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getConfiguration() { - return _configuration; - } - - - public void setConfiguration(List _configuration) { - this._configuration = _configuration; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertDTO alert = (AlertDTO) o; - return Objects.equals(this.id, alert.id) && - Objects.equals(this.name, alert.name) && - Objects.equals(this._configuration, alert._configuration); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, _configuration); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertDTO {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" _configuration: ").append(toIndentedString(_configuration)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypeDTO.java deleted file mode 100644 index eb48678050..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypeDTO.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertTypeDTO -*/ - -public class AlertTypeDTO { - public static final String SERIALIZED_NAME_ID = "id"; - @SerializedName(SERIALIZED_NAME_ID) - private Integer id; - - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_REQUIRE_CONFIGURATION = "requireConfiguration"; - @SerializedName(SERIALIZED_NAME_REQUIRE_CONFIGURATION) - private Boolean requireConfiguration; - - - public AlertTypeDTO id(Integer id) { - - this.id = id; - return this; - } - - /** - * The alert Id - * @return id - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "The alert Id") - - public Integer getId() { - return id; - } - - - public void setId(Integer id) { - this.id = id; - } - - - public AlertTypeDTO name(String name) { - - this.name = name; - return this; - } - - /** - * The name of the alert. - * @return name - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "AbnormalRequestTime", value = "The name of the alert.") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public AlertTypeDTO requireConfiguration(Boolean requireConfiguration) { - - this.requireConfiguration = requireConfiguration; - return this; - } - - /** - * Whether the alert type require additional configurations. - * @return requireConfiguration - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "true", value = "Whether the alert type require additional configurations.") - - public Boolean isRequireConfiguration() { - return requireConfiguration; - } - - - public void setRequireConfiguration(Boolean requireConfiguration) { - this.requireConfiguration = requireConfiguration; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertTypeDTO alertType = (AlertTypeDTO) o; - return Objects.equals(this.id, alertType.id) && - Objects.equals(this.name, alertType.name) && - Objects.equals(this.requireConfiguration, alertType.requireConfiguration); - } - - @Override - public int hashCode() { - return Objects.hash(id, name, requireConfiguration); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertTypeDTO {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" requireConfiguration: ").append(toIndentedString(requireConfiguration)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypesListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypesListDTO.java deleted file mode 100644 index fa99414391..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertTypesListDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertTypeDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertTypesListDTO -*/ - -public class AlertTypesListDTO { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) - private Integer count; - - public static final String SERIALIZED_NAME_ALERTS = "alerts"; - @SerializedName(SERIALIZED_NAME_ALERTS) - private List alerts = null; - - - public AlertTypesListDTO count(Integer count) { - - this.count = count; - return this; - } - - /** - * The number of alerts - * @return count - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "3", value = "The number of alerts") - - public Integer getCount() { - return count; - } - - - public void setCount(Integer count) { - this.count = count; - } - - - public AlertTypesListDTO alerts(List alerts) { - - this.alerts = alerts; - return this; - } - - /** - * Get alerts - * @return alerts - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getAlerts() { - return alerts; - } - - - public void setAlerts(List alerts) { - this.alerts = alerts; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertTypesListDTO alertTypesList = (AlertTypesListDTO) o; - return Objects.equals(this.count, alertTypesList.count) && - Objects.equals(this.alerts, alertTypesList.alerts); - } - - @Override - public int hashCode() { - return Objects.hash(count, alerts); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertTypesListDTO {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" alerts: ").append(toIndentedString(alerts)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoDTO.java deleted file mode 100644 index 154fcaf5b2..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertsInfoDTO -*/ - -public class AlertsInfoDTO { - public static final String SERIALIZED_NAME_ALERTS = "alerts"; - @SerializedName(SERIALIZED_NAME_ALERTS) - private List alerts = null; - - public static final String SERIALIZED_NAME_EMAIL_LIST = "emailList"; - @SerializedName(SERIALIZED_NAME_EMAIL_LIST) - private List emailList = null; - - - public AlertsInfoDTO alerts(List alerts) { - - this.alerts = alerts; - return this; - } - - /** - * Get alerts - * @return alerts - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getAlerts() { - return alerts; - } - - - public void setAlerts(List alerts) { - this.alerts = alerts; - } - - - public AlertsInfoDTO emailList(List emailList) { - - this.emailList = emailList; - return this; - } - - /** - * Get emailList - * @return emailList - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getEmailList() { - return emailList; - } - - - public void setEmailList(List emailList) { - this.emailList = emailList; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertsInfoDTO alertsInfo = (AlertsInfoDTO) o; - return Objects.equals(this.alerts, alertsInfo.alerts) && - Objects.equals(this.emailList, alertsInfo.emailList); - } - - @Override - public int hashCode() { - return Objects.hash(alerts, emailList); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertsInfoDTO {\n"); - sb.append(" alerts: ").append(toIndentedString(alerts)).append("\n"); - sb.append(" emailList: ").append(toIndentedString(emailList)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoResponseDTO.java deleted file mode 100644 index 35a79f42cc..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AlertsInfoResponseDTO.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertConfigDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.AlertDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* AlertsInfoResponseDTO -*/ - -public class AlertsInfoResponseDTO { - public static final String SERIALIZED_NAME_ALERTS = "alerts"; - @SerializedName(SERIALIZED_NAME_ALERTS) - private List alerts = null; - - public static final String SERIALIZED_NAME_EMAIL_LIST = "emailList"; - @SerializedName(SERIALIZED_NAME_EMAIL_LIST) - private List emailList = null; - - public static final String SERIALIZED_NAME_FAILED_CONFIGURATIONS = "failedConfigurations"; - @SerializedName(SERIALIZED_NAME_FAILED_CONFIGURATIONS) - private List failedConfigurations = null; - - - public AlertsInfoResponseDTO alerts(List alerts) { - - this.alerts = alerts; - return this; - } - - /** - * Get alerts - * @return alerts - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getAlerts() { - return alerts; - } - - - public void setAlerts(List alerts) { - this.alerts = alerts; - } - - - public AlertsInfoResponseDTO emailList(List emailList) { - - this.emailList = emailList; - return this; - } - - /** - * Get emailList - * @return emailList - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getEmailList() { - return emailList; - } - - - public void setEmailList(List emailList) { - this.emailList = emailList; - } - - - public AlertsInfoResponseDTO failedConfigurations(List failedConfigurations) { - - this.failedConfigurations = failedConfigurations; - return this; - } - - /** - * Get failedConfigurations - * @return failedConfigurations - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getFailedConfigurations() { - return failedConfigurations; - } - - - public void setFailedConfigurations(List failedConfigurations) { - this.failedConfigurations = failedConfigurations; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AlertsInfoResponseDTO alertsInfoResponse = (AlertsInfoResponseDTO) o; - return Objects.equals(this.alerts, alertsInfoResponse.alerts) && - Objects.equals(this.emailList, alertsInfoResponse.emailList) && - Objects.equals(this.failedConfigurations, alertsInfoResponse.failedConfigurations); - } - - @Override - public int hashCode() { - return Objects.hash(alerts, emailList, failedConfigurations); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class AlertsInfoResponseDTO {\n"); - sb.append(" alerts: ").append(toIndentedString(alerts)).append("\n"); - sb.append(" emailList: ").append(toIndentedString(emailList)).append("\n"); - sb.append(" failedConfigurations: ").append(toIndentedString(failedConfigurations)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApiEndpointValidationResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApiEndpointValidationResponseDTO.java index 3528937032..e1fa849c09 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApiEndpointValidationResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApiEndpointValidationResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationDTO.java index 05599acb48..3fbd1b7c83 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationInfoDTO.java index ac43989148..005d0a5bc6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ApplicationInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseDTO.java index 6b6d551b2b..3eb267fa17 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseInfoDTO.java index 7b4791fef7..f994c4a258 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AsyncAPISpecificationValidationResponseInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -52,6 +52,10 @@ public class AsyncAPISpecificationValidationResponseInfoDTO { @SerializedName(SERIALIZED_NAME_ASYNC_A_P_I_VERSION) private String asyncAPIVersion; + public static final String SERIALIZED_NAME_PROTOCOL = "protocol"; + @SerializedName(SERIALIZED_NAME_PROTOCOL) + private String protocol; + public static final String SERIALIZED_NAME_ENDPOINTS = "endpoints"; @SerializedName(SERIALIZED_NAME_ENDPOINTS) private List endpoints = null; @@ -172,6 +176,29 @@ public void setAsyncAPIVersion(String asyncAPIVersion) { } + public AsyncAPISpecificationValidationResponseInfoDTO protocol(String protocol) { + + this.protocol = protocol; + return this; + } + + /** + * Get protocol + * @return protocol + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "WEBSUB", value = "") + + public String getProtocol() { + return protocol; + } + + + public void setProtocol(String protocol) { + this.protocol = protocol; + } + + public AsyncAPISpecificationValidationResponseInfoDTO endpoints(List endpoints) { this.endpoints = endpoints; @@ -209,12 +236,13 @@ public boolean equals(Object o) { Objects.equals(this.context, asyncAPISpecificationValidationResponseInfo.context) && Objects.equals(this.description, asyncAPISpecificationValidationResponseInfo.description) && Objects.equals(this.asyncAPIVersion, asyncAPISpecificationValidationResponseInfo.asyncAPIVersion) && + Objects.equals(this.protocol, asyncAPISpecificationValidationResponseInfo.protocol) && Objects.equals(this.endpoints, asyncAPISpecificationValidationResponseInfo.endpoints); } @Override public int hashCode() { - return Objects.hash(name, version, context, description, asyncAPIVersion, endpoints); + return Objects.hash(name, version, context, description, asyncAPIVersion, protocol, endpoints); } @@ -227,6 +255,7 @@ public String toString() { sb.append(" context: ").append(toIndentedString(context)).append("\n"); sb.append(" description: ").append(toIndentedString(description)).append("\n"); sb.append(" asyncAPIVersion: ").append(toIndentedString(asyncAPIVersion)).append("\n"); + sb.append(" protocol: ").append(toIndentedString(protocol)).append("\n"); sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AuditReportDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AuditReportDTO.java index 623e6c2550..18ec659a94 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AuditReportDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/AuditReportDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitAllOfDTO.java index 45233bd5b4..69bff42a53 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitDTO.java index aa7db1c430..37fd72de89 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/BandwidthLimitDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertMetadataDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertMetadataDTO.java index bbd6cb72aa..ecf2377bcf 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertMetadataDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertMetadataDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateInfoDTO.java index 7b69ad2ea7..878c8812e5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateValidityDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateValidityDTO.java index a2c6c5a87c..2359718018 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateValidityDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificateValidityDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificatesDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificatesDTO.java index af0637fec0..2913d5bbd2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificatesDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CertificatesDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClaimDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClaimDTO.java index 64e849d297..060270341d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClaimDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClaimDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java index 36fba582f8..dbeee3f695 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertMetadataDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertificatesDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertificatesDTO.java index 863723e5a8..30754a4389 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertificatesDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ClientCertificatesDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentDTO.java index 6854eb52b8..001841bdab 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -244,7 +244,7 @@ public CommentDTO category(String category) { * @return category **/ @javax.annotation.Nullable - @ApiModelProperty(value = "") + @ApiModelProperty(example = "general", value = "") public String getCategory() { return category; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentListDTO.java index 737b5d35cc..e77715a2d9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommentListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommenterInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommenterInfoDTO.java index 82dd8e1d0b..252e3bdee6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommenterInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CommenterInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CustomAttributeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CustomAttributeDTO.java index cb89e1a841..ae27445a83 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CustomAttributeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/CustomAttributeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterInfoDTO.java deleted file mode 100644 index a15a5ad28c..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterInfoDTO.java +++ /dev/null @@ -1,185 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentClusterInfoDTO -*/ - -public class DeploymentClusterInfoDTO { - public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; - @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) - private String clusterName; - - public static final String SERIALIZED_NAME_ACCESS_U_R_L = "accessURL"; - @SerializedName(SERIALIZED_NAME_ACCESS_U_R_L) - private String accessURL; - - public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; - @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) - private String displayName; - - public static final String SERIALIZED_NAME_PROPERTIES = "properties"; - @SerializedName(SERIALIZED_NAME_PROPERTIES) - private Map properties = new HashMap(); - - - public DeploymentClusterInfoDTO clusterName(String clusterName) { - - this.clusterName = clusterName; - return this; - } - - /** - * Get clusterName - * @return clusterName - **/ - @ApiModelProperty(example = "minikube", required = true, value = "") - - public String getClusterName() { - return clusterName; - } - - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - - public DeploymentClusterInfoDTO accessURL(String accessURL) { - - this.accessURL = accessURL; - return this; - } - - /** - * Get accessURL - * @return accessURL - **/ - @ApiModelProperty(example = "https://api.com", required = true, value = "") - - public String getAccessURL() { - return accessURL; - } - - - public void setAccessURL(String accessURL) { - this.accessURL = accessURL; - } - - - public DeploymentClusterInfoDTO displayName(String displayName) { - - this.displayName = displayName; - return this; - } - - /** - * Get displayName - * @return displayName - **/ - @ApiModelProperty(example = "kubernetes-minikube", required = true, value = "") - - public String getDisplayName() { - return displayName; - } - - - public void setDisplayName(String displayName) { - this.displayName = displayName; - } - - - public DeploymentClusterInfoDTO properties(Map properties) { - - this.properties = properties; - return this; - } - - /** - * Get properties - * @return properties - **/ - @ApiModelProperty(required = true, value = "") - - public Map getProperties() { - return properties; - } - - - public void setProperties(Map properties) { - this.properties = properties; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentClusterInfoDTO deploymentClusterInfo = (DeploymentClusterInfoDTO) o; - return Objects.equals(this.clusterName, deploymentClusterInfo.clusterName) && - Objects.equals(this.accessURL, deploymentClusterInfo.accessURL) && - Objects.equals(this.displayName, deploymentClusterInfo.displayName) && - Objects.equals(this.properties, deploymentClusterInfo.properties); - } - - @Override - public int hashCode() { - return Objects.hash(clusterName, accessURL, displayName, properties); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentClusterInfoDTO {\n"); - sb.append(" clusterName: ").append(toIndentedString(clusterName)).append("\n"); - sb.append(" accessURL: ").append(toIndentedString(accessURL)).append("\n"); - sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); - sb.append(" properties: ").append(toIndentedString(properties)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterStatusDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterStatusDTO.java deleted file mode 100644 index fc7db84df3..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentClusterStatusDTO.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.PodStatusDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentClusterStatusDTO -*/ - -public class DeploymentClusterStatusDTO { - public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; - @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) - private String clusterName; - - public static final String SERIALIZED_NAME_PODS_RUNNING = "podsRunning"; - @SerializedName(SERIALIZED_NAME_PODS_RUNNING) - private Integer podsRunning; - - public static final String SERIALIZED_NAME_HEALTH_STATUS = "healthStatus"; - @SerializedName(SERIALIZED_NAME_HEALTH_STATUS) - private List healthStatus = new ArrayList(); - - - public DeploymentClusterStatusDTO clusterName(String clusterName) { - - this.clusterName = clusterName; - return this; - } - - /** - * Get clusterName - * @return clusterName - **/ - @ApiModelProperty(example = "Minikube", required = true, value = "") - - public String getClusterName() { - return clusterName; - } - - - public void setClusterName(String clusterName) { - this.clusterName = clusterName; - } - - - public DeploymentClusterStatusDTO podsRunning(Integer podsRunning) { - - this.podsRunning = podsRunning; - return this; - } - - /** - * Get podsRunning - * @return podsRunning - **/ - @ApiModelProperty(required = true, value = "") - - public Integer getPodsRunning() { - return podsRunning; - } - - - public void setPodsRunning(Integer podsRunning) { - this.podsRunning = podsRunning; - } - - - public DeploymentClusterStatusDTO healthStatus(List healthStatus) { - - this.healthStatus = healthStatus; - return this; - } - - /** - * Get healthStatus - * @return healthStatus - **/ - @ApiModelProperty(required = true, value = "") - - public List getHealthStatus() { - return healthStatus; - } - - - public void setHealthStatus(List healthStatus) { - this.healthStatus = healthStatus; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentClusterStatusDTO deploymentClusterStatus = (DeploymentClusterStatusDTO) o; - return Objects.equals(this.clusterName, deploymentClusterStatus.clusterName) && - Objects.equals(this.podsRunning, deploymentClusterStatus.podsRunning) && - Objects.equals(this.healthStatus, deploymentClusterStatus.healthStatus); - } - - @Override - public int hashCode() { - return Objects.hash(clusterName, podsRunning, healthStatus); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentClusterStatusDTO {\n"); - sb.append(" clusterName: ").append(toIndentedString(clusterName)).append("\n"); - sb.append(" podsRunning: ").append(toIndentedString(podsRunning)).append("\n"); - sb.append(" healthStatus: ").append(toIndentedString(healthStatus)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentEnvironmentsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentEnvironmentsDTO.java deleted file mode 100644 index 0227297f35..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentEnvironmentsDTO.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentEnvironmentsDTO -*/ - -public class DeploymentEnvironmentsDTO { - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_CLUSTER_NAME = "clusterName"; - @SerializedName(SERIALIZED_NAME_CLUSTER_NAME) - private List clusterName = new ArrayList(); - - - public DeploymentEnvironmentsDTO type(String type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @ApiModelProperty(example = "Kubernetes", required = true, value = "") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public DeploymentEnvironmentsDTO clusterName(List clusterName) { - - this.clusterName = clusterName; - return this; - } - - /** - * Get clusterName - * @return clusterName - **/ - @ApiModelProperty(example = "[\"minikube\"]", required = true, value = "") - - public List getClusterName() { - return clusterName; - } - - - public void setClusterName(List clusterName) { - this.clusterName = clusterName; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentEnvironmentsDTO deploymentEnvironments = (DeploymentEnvironmentsDTO) o; - return Objects.equals(this.type, deploymentEnvironments.type) && - Objects.equals(this.clusterName, deploymentEnvironments.clusterName); - } - - @Override - public int hashCode() { - return Objects.hash(type, clusterName); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentEnvironmentsDTO {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" clusterName: ").append(toIndentedString(clusterName)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentListDTO.java deleted file mode 100644 index bb4a7e3c83..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentListDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentsDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentListDTO -*/ - -public class DeploymentListDTO { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) - private Integer count; - - public static final String SERIALIZED_NAME_LIST = "list"; - @SerializedName(SERIALIZED_NAME_LIST) - private List list = null; - - - public DeploymentListDTO count(Integer count) { - - this.count = count; - return this; - } - - /** - * Number of deployment clusters returned. - * @return count - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "Number of deployment clusters returned. ") - - public Integer getCount() { - return count; - } - - - public void setCount(Integer count) { - this.count = count; - } - - - public DeploymentListDTO list(List list) { - - this.list = list; - return this; - } - - /** - * Get list - * @return list - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getList() { - return list; - } - - - public void setList(List list) { - this.list = list; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentListDTO deploymentList = (DeploymentListDTO) o; - return Objects.equals(this.count, deploymentList.count) && - Objects.equals(this.list, deploymentList.list); - } - - @Override - public int hashCode() { - return Objects.hash(count, list); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentListDTO {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" list: ").append(toIndentedString(list)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusDTO.java deleted file mode 100644 index 96df533313..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusDTO.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentClusterStatusDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentStatusDTO -*/ - -public class DeploymentStatusDTO { - public static final String SERIALIZED_NAME_TYPE = "type"; - @SerializedName(SERIALIZED_NAME_TYPE) - private String type; - - public static final String SERIALIZED_NAME_CLUSTERS = "clusters"; - @SerializedName(SERIALIZED_NAME_CLUSTERS) - private List clusters = new ArrayList(); - - - public DeploymentStatusDTO type(String type) { - - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @ApiModelProperty(example = "Kubernetes", required = true, value = "") - - public String getType() { - return type; - } - - - public void setType(String type) { - this.type = type; - } - - - public DeploymentStatusDTO clusters(List clusters) { - - this.clusters = clusters; - return this; - } - - /** - * Get clusters - * @return clusters - **/ - @ApiModelProperty(required = true, value = "") - - public List getClusters() { - return clusters; - } - - - public void setClusters(List clusters) { - this.clusters = clusters; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentStatusDTO deploymentStatus = (DeploymentStatusDTO) o; - return Objects.equals(this.type, deploymentStatus.type) && - Objects.equals(this.clusters, deploymentStatus.clusters); - } - - @Override - public int hashCode() { - return Objects.hash(type, clusters); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentStatusDTO {\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" clusters: ").append(toIndentedString(clusters)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusListDTO.java deleted file mode 100644 index bacb64f923..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentStatusListDTO.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentStatusDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentStatusListDTO -*/ - -public class DeploymentStatusListDTO { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) - private Integer count; - - public static final String SERIALIZED_NAME_LIST = "list"; - @SerializedName(SERIALIZED_NAME_LIST) - private List list = null; - - - public DeploymentStatusListDTO count(Integer count) { - - this.count = count; - return this; - } - - /** - * Status of the deployments returned. - * @return count - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "Status of the deployments returned. ") - - public Integer getCount() { - return count; - } - - - public void setCount(Integer count) { - this.count = count; - } - - - public DeploymentStatusListDTO list(List list) { - - this.list = list; - return this; - } - - /** - * Get list - * @return list - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getList() { - return list; - } - - - public void setList(List list) { - this.list = list; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentStatusListDTO deploymentStatusList = (DeploymentStatusListDTO) o; - return Objects.equals(this.count, deploymentStatusList.count) && - Objects.equals(this.list, deploymentStatusList.list); - } - - @Override - public int hashCode() { - return Objects.hash(count, list); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentStatusListDTO {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" list: ").append(toIndentedString(list)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentsDTO.java deleted file mode 100644 index 791e6a704a..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DeploymentsDTO.java +++ /dev/null @@ -1,129 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentClusterInfoDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* DeploymentsDTO -*/ - -public class DeploymentsDTO { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_CLUSTERS = "clusters"; - @SerializedName(SERIALIZED_NAME_CLUSTERS) - private List clusters = new ArrayList(); - - - public DeploymentsDTO name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(example = "Kubernetes", required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public DeploymentsDTO clusters(List clusters) { - - this.clusters = clusters; - return this; - } - - /** - * Get clusters - * @return clusters - **/ - @ApiModelProperty(required = true, value = "") - - public List getClusters() { - return clusters; - } - - - public void setClusters(List clusters) { - this.clusters = clusters; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DeploymentsDTO deployments = (DeploymentsDTO) o; - return Objects.equals(this.name, deployments.name) && - Objects.equals(this.clusters, deployments.clusters); - } - - @Override - public int hashCode() { - return Objects.hash(name, clusters); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class DeploymentsDTO {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" clusters: ").append(toIndentedString(clusters)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentDTO.java index 71b1e0689d..c09f588679 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentListDTO.java index 4d47a27fad..9baac5f442 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultAllOfDTO.java index 364266d174..773fc5446f 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -103,7 +103,9 @@ public enum SourceTypeEnum { URL("URL"), - FILE("FILE"); + FILE("FILE"), + + MARKDOWN("MARKDOWN"); private String value; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultDTO.java index 7a70b5825f..6ce200ec0a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/DocumentSearchResultDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -105,7 +105,9 @@ public enum SourceTypeEnum { URL("URL"), - FILE("FILE"); + FILE("FILE"), + + MARKDOWN("MARKDOWN"); private String value; diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigAttributesDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigAttributesDTO.java index 475b89d864..7b72011218 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigAttributesDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigAttributesDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigDTO.java index 1bc7ba2e39..9fdfbeaad6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointConfigDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointDTO.java index 64042e7336..96b82be110 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointConfigDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointConfigDTO.java index 850cfdb680..d82417a12d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointConfigDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointConfigDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointSecurityDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointSecurityDTO.java index a72d95f3d3..4ab9f6ced8 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointSecurityDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointEndpointSecurityDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointListDTO.java index d46c4b27b4..d5e63dad1e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EndpointListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentDTO.java index ea4cce6977..97cf526412 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.EnvironmentEndpointsDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.VHostDTO; import com.fasterxml.jackson.annotation.JsonCreator; /** @@ -53,10 +52,6 @@ public class EnvironmentDTO { @SerializedName(SERIALIZED_NAME_SHOW_IN_API_CONSOLE) private Boolean showInApiConsole; - public static final String SERIALIZED_NAME_ENDPOINTS = "endpoints"; - @SerializedName(SERIALIZED_NAME_ENDPOINTS) - private EnvironmentEndpointsDTO endpoints; - public static final String SERIALIZED_NAME_VHOSTS = "vhosts"; @SerializedName(SERIALIZED_NAME_VHOSTS) private List vhosts = null; @@ -173,28 +168,6 @@ public void setShowInApiConsole(Boolean showInApiConsole) { } - public EnvironmentDTO endpoints(EnvironmentEndpointsDTO endpoints) { - - this.endpoints = endpoints; - return this; - } - - /** - * Get endpoints - * @return endpoints - **/ - @ApiModelProperty(required = true, value = "") - - public EnvironmentEndpointsDTO getEndpoints() { - return endpoints; - } - - - public void setEndpoints(EnvironmentEndpointsDTO endpoints) { - this.endpoints = endpoints; - } - - public EnvironmentDTO vhosts(List vhosts) { this.vhosts = vhosts; @@ -232,13 +205,12 @@ public boolean equals(Object o) { Objects.equals(this.type, environment.type) && Objects.equals(this.serverUrl, environment.serverUrl) && Objects.equals(this.showInApiConsole, environment.showInApiConsole) && - Objects.equals(this.endpoints, environment.endpoints) && Objects.equals(this.vhosts, environment.vhosts); } @Override public int hashCode() { - return Objects.hash(name, displayName, type, serverUrl, showInApiConsole, endpoints, vhosts); + return Objects.hash(name, displayName, type, serverUrl, showInApiConsole, vhosts); } @@ -251,7 +223,6 @@ public String toString() { sb.append(" type: ").append(toIndentedString(type)).append("\n"); sb.append(" serverUrl: ").append(toIndentedString(serverUrl)).append("\n"); sb.append(" showInApiConsole: ").append(toIndentedString(showInApiConsole)).append("\n"); - sb.append(" endpoints: ").append(toIndentedString(endpoints)).append("\n"); sb.append(" vhosts: ").append(toIndentedString(vhosts)).append("\n"); sb.append("}"); return sb.toString(); diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentEndpointsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentEndpointsDTO.java deleted file mode 100644 index d92f4945cf..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentEndpointsDTO.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* EnvironmentEndpointsDTO -*/ - -public class EnvironmentEndpointsDTO { - public static final String SERIALIZED_NAME_HTTP = "http"; - @SerializedName(SERIALIZED_NAME_HTTP) - private String http; - - public static final String SERIALIZED_NAME_HTTPS = "https"; - @SerializedName(SERIALIZED_NAME_HTTPS) - private String https; - - public static final String SERIALIZED_NAME_WS = "ws"; - @SerializedName(SERIALIZED_NAME_WS) - private String ws; - - public static final String SERIALIZED_NAME_WSS = "wss"; - @SerializedName(SERIALIZED_NAME_WSS) - private String wss; - - - public EnvironmentEndpointsDTO http(String http) { - - this.http = http; - return this; - } - - /** - * HTTP environment URL - * @return http - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "http://localhost:8280", value = "HTTP environment URL") - - public String getHttp() { - return http; - } - - - public void setHttp(String http) { - this.http = http; - } - - - public EnvironmentEndpointsDTO https(String https) { - - this.https = https; - return this; - } - - /** - * HTTPS environment URL - * @return https - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "https://localhost:8243", value = "HTTPS environment URL") - - public String getHttps() { - return https; - } - - - public void setHttps(String https) { - this.https = https; - } - - - public EnvironmentEndpointsDTO ws(String ws) { - - this.ws = ws; - return this; - } - - /** - * WS environment URL - * @return ws - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "http://localhost:9099", value = "WS environment URL") - - public String getWs() { - return ws; - } - - - public void setWs(String ws) { - this.ws = ws; - } - - - public EnvironmentEndpointsDTO wss(String wss) { - - this.wss = wss; - return this; - } - - /** - * WSS environment URL - * @return wss - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "https://localhost:8099", value = "WSS environment URL") - - public String getWss() { - return wss; - } - - - public void setWss(String wss) { - this.wss = wss; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnvironmentEndpointsDTO environmentEndpoints = (EnvironmentEndpointsDTO) o; - return Objects.equals(this.http, environmentEndpoints.http) && - Objects.equals(this.https, environmentEndpoints.https) && - Objects.equals(this.ws, environmentEndpoints.ws) && - Objects.equals(this.wss, environmentEndpoints.wss); - } - - @Override - public int hashCode() { - return Objects.hash(http, https, ws, wss); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class EnvironmentEndpointsDTO {\n"); - sb.append(" http: ").append(toIndentedString(http)).append("\n"); - sb.append(" https: ").append(toIndentedString(https)).append("\n"); - sb.append(" ws: ").append(toIndentedString(ws)).append("\n"); - sb.append(" wss: ").append(toIndentedString(wss)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentListDTO.java index 6f0826b404..88937f26c8 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EnvironmentListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorDTO.java index 982646b409..d4586ad8e3 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorListItemDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorListItemDTO.java index a9f743c28d..acf8fab243 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorListItemDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ErrorListItemDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitAllOfDTO.java index 36960a92d0..921240ed8c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitDTO.java index c6de39c194..780cfe1fa6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/EventCountLimitDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreDTO.java index df13b26df7..c672637fcd 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreListDTO.java index fd9e3bba5f..25524e19fa 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ExternalStoreListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/FileInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/FileInfoDTO.java index 7abfe0f5d1..09ae255bf3 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/FileInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/FileInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLCustomComplexityInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLCustomComplexityInfoDTO.java index cfdba84519..a4b24b85b1 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLCustomComplexityInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLCustomComplexityInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryComplexityInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryComplexityInfoDTO.java index c01c6195d9..07d0907f5d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryComplexityInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryComplexityInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryDTO.java new file mode 100644 index 0000000000..6e688fe841 --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLQueryDTO.java @@ -0,0 +1,128 @@ +/* + * WSO2 API Manager - Publisher API + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * + * The version of the OpenAPI document: v2 + * Contact: architecture@wso2.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.wso2.am.integration.clients.publisher.api.v1.dto; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonCreator; +/** +* GraphQLQueryDTO +*/ + +public class GraphQLQueryDTO { + public static final String SERIALIZED_NAME_GRAPH_Q_L_MAX_COMPLEXITY = "graphQLMaxComplexity"; + @SerializedName(SERIALIZED_NAME_GRAPH_Q_L_MAX_COMPLEXITY) + private Integer graphQLMaxComplexity; + + public static final String SERIALIZED_NAME_GRAPH_Q_L_MAX_DEPTH = "graphQLMaxDepth"; + @SerializedName(SERIALIZED_NAME_GRAPH_Q_L_MAX_DEPTH) + private Integer graphQLMaxDepth; + + + public GraphQLQueryDTO graphQLMaxComplexity(Integer graphQLMaxComplexity) { + + this.graphQLMaxComplexity = graphQLMaxComplexity; + return this; + } + + /** + * Maximum Complexity of the GraphQL query + * @return graphQLMaxComplexity + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "400", value = "Maximum Complexity of the GraphQL query") + + public Integer getGraphQLMaxComplexity() { + return graphQLMaxComplexity; + } + + + public void setGraphQLMaxComplexity(Integer graphQLMaxComplexity) { + this.graphQLMaxComplexity = graphQLMaxComplexity; + } + + + public GraphQLQueryDTO graphQLMaxDepth(Integer graphQLMaxDepth) { + + this.graphQLMaxDepth = graphQLMaxDepth; + return this; + } + + /** + * Maximum Depth of the GraphQL query + * @return graphQLMaxDepth + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "10", value = "Maximum Depth of the GraphQL query") + + public Integer getGraphQLMaxDepth() { + return graphQLMaxDepth; + } + + + public void setGraphQLMaxDepth(Integer graphQLMaxDepth) { + this.graphQLMaxDepth = graphQLMaxDepth; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GraphQLQueryDTO graphQLQuery = (GraphQLQueryDTO) o; + return Objects.equals(this.graphQLMaxComplexity, graphQLQuery.graphQLMaxComplexity) && + Objects.equals(this.graphQLMaxDepth, graphQLQuery.graphQLMaxDepth); + } + + @Override + public int hashCode() { + return Objects.hash(graphQLMaxComplexity, graphQLMaxDepth); + } + + +@Override +public String toString() { +StringBuilder sb = new StringBuilder(); +sb.append("class GraphQLQueryDTO {\n"); + sb.append(" graphQLMaxComplexity: ").append(toIndentedString(graphQLMaxComplexity)).append("\n"); + sb.append(" graphQLMaxDepth: ").append(toIndentedString(graphQLMaxDepth)).append("\n"); +sb.append("}"); +return sb.toString(); +} + +/** +* Convert the given object to string with each line indented by 4 spaces +* (except the first line). +*/ +private String toIndentedString(Object o) { +if (o == null) { +return "null"; +} +return o.toString().replace("\n", "\n "); +} + +} + diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaDTO.java index 190a940db0..0f72d6d49c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeDTO.java index 5d369a1aa4..c6d4e843a2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeListDTO.java index f69c1cfb44..ce067136ef 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLSchemaTypeListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseDTO.java index 650abac01a..89d4195989 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseGraphQLInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseGraphQLInfoDTO.java index 3cc36715c7..f9ee90557b 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseGraphQLInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/GraphQLValidationResponseGraphQLInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerInfoDTO.java index 160dfb2e79..535a78167e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerListDTO.java index 212d7b675d..8869262a38 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/KeyManagerListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelDTO.java deleted file mode 100644 index 30d793a32e..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelDTO.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* LabelDTO -*/ - -public class LabelDTO { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_DESCRIPTION = "description"; - @SerializedName(SERIALIZED_NAME_DESCRIPTION) - private String description; - - public static final String SERIALIZED_NAME_ACCESS_URLS = "access_urls"; - @SerializedName(SERIALIZED_NAME_ACCESS_URLS) - private List accessUrls = null; - - - public LabelDTO name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(example = "marketing_store", required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public LabelDTO description(String description) { - - this.description = description; - return this; - } - - /** - * Get description - * @return description - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "Public microgateway for marketing", value = "") - - public String getDescription() { - return description; - } - - - public void setDescription(String description) { - this.description = description; - } - - - public LabelDTO accessUrls(List accessUrls) { - - this.accessUrls = accessUrls; - return this; - } - - /** - * Get accessUrls - * @return accessUrls - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "https://localhost:9095", value = "") - - public List getAccessUrls() { - return accessUrls; - } - - - public void setAccessUrls(List accessUrls) { - this.accessUrls = accessUrls; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LabelDTO label = (LabelDTO) o; - return Objects.equals(this.name, label.name) && - Objects.equals(this.description, label.description) && - Objects.equals(this.accessUrls, label.accessUrls); - } - - @Override - public int hashCode() { - return Objects.hash(name, description, accessUrls); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class LabelDTO {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" description: ").append(toIndentedString(description)).append("\n"); - sb.append(" accessUrls: ").append(toIndentedString(accessUrls)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelListDTO.java deleted file mode 100644 index 647a48aae9..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LabelListDTO.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.LabelDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.PaginationDTO; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* LabelListDTO -*/ - -public class LabelListDTO { - public static final String SERIALIZED_NAME_COUNT = "count"; - @SerializedName(SERIALIZED_NAME_COUNT) - private Integer count; - - public static final String SERIALIZED_NAME_LIST = "list"; - @SerializedName(SERIALIZED_NAME_LIST) - private List list = null; - - public static final String SERIALIZED_NAME_PAGINATION = "pagination"; - @SerializedName(SERIALIZED_NAME_PAGINATION) - private PaginationDTO pagination; - - - public LabelListDTO count(Integer count) { - - this.count = count; - return this; - } - - /** - * Number of Labels returned. - * @return count - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "1", value = "Number of Labels returned. ") - - public Integer getCount() { - return count; - } - - - public void setCount(Integer count) { - this.count = count; - } - - - public LabelListDTO list(List list) { - - this.list = list; - return this; - } - - /** - * Get list - * @return list - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getList() { - return list; - } - - - public void setList(List list) { - this.list = list; - } - - - public LabelListDTO pagination(PaginationDTO pagination) { - - this.pagination = pagination; - return this; - } - - /** - * Get pagination - * @return pagination - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public PaginationDTO getPagination() { - return pagination; - } - - - public void setPagination(PaginationDTO pagination) { - this.pagination = pagination; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - LabelListDTO labelList = (LabelListDTO) o; - return Objects.equals(this.count, labelList.count) && - Objects.equals(this.list, labelList.list) && - Objects.equals(this.pagination, labelList.pagination); - } - - @Override - public int hashCode() { - return Objects.hash(count, list, pagination); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class LabelListDTO {\n"); - sb.append(" count: ").append(toIndentedString(count)).append("\n"); - sb.append(" list: ").append(toIndentedString(list)).append("\n"); - sb.append(" pagination: ").append(toIndentedString(pagination)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryDTO.java index c593b1df5d..dbbda0941a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryItemDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryItemDTO.java index 238bd9b5a0..9e6f816e31 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryItemDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleHistoryItemDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateAvailableTransitionsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateAvailableTransitionsDTO.java index 11fa2d58b7..25ed521a41 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateAvailableTransitionsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateAvailableTransitionsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateCheckItemsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateCheckItemsDTO.java index e4ec779e7f..759a0ffee6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateCheckItemsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateCheckItemsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateDTO.java index b3e25580b9..248ad2b75a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/LifecycleStateDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationDTO.java index 5349739f53..20df516046 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationInfoDTO.java index 1021fbf1bd..162089b7db 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationListDTO.java index f3c28a08b0..3237a0610f 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationPolicyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationPolicyDTO.java index 708ab3eb95..856b8b2e6e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationPolicyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MediationPolicyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadInfoDTO.java index 3dfbc20fb0..f6d83cd2f9 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadListDTO.java index ede12dee90..1900711ae6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MockResponsePayloadListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationAttributeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationAttributeDTO.java index 44409971d5..69649c635f 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationAttributeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationAttributeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationInfoDTO.java index f122376fe6..5dab4d0b69 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/MonetizationInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseDTO.java index 3ddb673f6e..0651d37e19 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseInfoDTO.java index b3b9f1eccf..1020a588d8 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/OpenAPIDefinitionValidationResponseInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PaginationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PaginationDTO.java index 3af8e2bcd3..a90583a97a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PaginationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PaginationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PatchRequestBodyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PatchRequestBodyDTO.java index 21913dbab8..6e110402d1 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PatchRequestBodyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PatchRequestBodyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PodStatusDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PodStatusDTO.java deleted file mode 100644 index 00da6c23a4..0000000000 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PodStatusDTO.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) - * - * The version of the OpenAPI document: v2 - * Contact: architecture@wso2.com - * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. - */ - - -package org.wso2.am.integration.clients.publisher.api.v1.dto; - -import java.util.Objects; -import java.util.Arrays; -import com.google.gson.TypeAdapter; -import com.google.gson.annotations.JsonAdapter; -import com.google.gson.annotations.SerializedName; -import com.google.gson.stream.JsonReader; -import com.google.gson.stream.JsonWriter; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.io.IOException; -import com.fasterxml.jackson.annotation.JsonCreator; -/** -* PodStatusDTO -*/ - -public class PodStatusDTO { - public static final String SERIALIZED_NAME_NAME = "name"; - @SerializedName(SERIALIZED_NAME_NAME) - private String name; - - public static final String SERIALIZED_NAME_READY = "ready"; - @SerializedName(SERIALIZED_NAME_READY) - private String ready; - - public static final String SERIALIZED_NAME_STATUS = "status"; - @SerializedName(SERIALIZED_NAME_STATUS) - private String status; - - public static final String SERIALIZED_NAME_CREATION_TIMESTAMP = "creationTimestamp"; - @SerializedName(SERIALIZED_NAME_CREATION_TIMESTAMP) - private String creationTimestamp; - - - public PodStatusDTO name(String name) { - - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(example = "petStore-677bb7cc65-shb2f", required = true, value = "") - - public String getName() { - return name; - } - - - public void setName(String name) { - this.name = name; - } - - - public PodStatusDTO ready(String ready) { - - this.ready = ready; - return this; - } - - /** - * Get ready - * @return ready - **/ - @ApiModelProperty(example = "1/1", required = true, value = "") - - public String getReady() { - return ready; - } - - - public void setReady(String ready) { - this.ready = ready; - } - - - public PodStatusDTO status(String status) { - - this.status = status; - return this; - } - - /** - * Get status - * @return status - **/ - @ApiModelProperty(example = "running", required = true, value = "") - - public String getStatus() { - return status; - } - - - public void setStatus(String status) { - this.status = status; - } - - - public PodStatusDTO creationTimestamp(String creationTimestamp) { - - this.creationTimestamp = creationTimestamp; - return this; - } - - /** - * Get creationTimestamp - * @return creationTimestamp - **/ - @javax.annotation.Nullable - @ApiModelProperty(example = "2020-05-12T06:12:00Z", value = "") - - public String getCreationTimestamp() { - return creationTimestamp; - } - - - public void setCreationTimestamp(String creationTimestamp) { - this.creationTimestamp = creationTimestamp; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - PodStatusDTO podStatus = (PodStatusDTO) o; - return Objects.equals(this.name, podStatus.name) && - Objects.equals(this.ready, podStatus.ready) && - Objects.equals(this.status, podStatus.status) && - Objects.equals(this.creationTimestamp, podStatus.creationTimestamp); - } - - @Override - public int hashCode() { - return Objects.hash(name, ready, status, creationTimestamp); - } - - -@Override -public String toString() { -StringBuilder sb = new StringBuilder(); -sb.append("class PodStatusDTO {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" ready: ").append(toIndentedString(ready)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" creationTimestamp: ").append(toIndentedString(creationTimestamp)).append("\n"); -sb.append("}"); -return sb.toString(); -} - -/** -* Convert the given object to string with each line indented by 4 spaces -* (except the first line). -*/ -private String toIndentedString(Object o) { -if (o == null) { -return "null"; -} -return o.toString().replace("\n", "\n "); -} - -} - diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PostRequestBodyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PostRequestBodyDTO.java index 3a94f72bd2..e815ba51cc 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PostRequestBodyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/PostRequestBodyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ProductAPIDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ProductAPIDTO.java index 8eb15cf291..b65d34dfbd 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ProductAPIDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ProductAPIDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitAllOfDTO.java index 4202199376..598765fdd4 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitDTO.java index e489750a38..6591eb99d7 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/RequestCountLimitDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathDTO.java index 41ea295eb0..f11fd2de88 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathListDTO.java index 2678ed9fb2..168491d461 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePathListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyInfoDTO.java index 5e0ebb597e..ce4e8f28a7 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyListDTO.java index 95843f3e0a..8df0ef7f40 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ResourcePolicyListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeDTO.java index 3fcab98edd..4dd75cc3fd 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeListDTO.java index 35270e3857..614e8dab2d 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ScopeListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultDTO.java index 9590e6a6e1..92fa1e5701 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultListDTO.java index fe652ed5b8..09dcd2850b 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SearchResultListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SecurityAuditAttributeDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SecurityAuditAttributeDTO.java index 9966707202..51bd55e646 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SecurityAuditAttributeDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SecurityAuditAttributeDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SettingsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SettingsDTO.java index 4a57a77fee..d955da9c03 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SettingsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SettingsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -25,7 +25,6 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; -import org.wso2.am.integration.clients.publisher.api.v1.dto.DeploymentsDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.EnvironmentDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.MonetizationAttributeDTO; import com.fasterxml.jackson.annotation.JsonCreator; @@ -66,10 +65,6 @@ public class SettingsDTO { @SerializedName(SERIALIZED_NAME_CROSS_TENANT_SUBSCRIPTION_ENABLED) private Boolean crossTenantSubscriptionEnabled = false; - public static final String SERIALIZED_NAME_DEPLOYMENTS = "deployments"; - @SerializedName(SERIALIZED_NAME_DEPLOYMENTS) - private List deployments = null; - public SettingsDTO devportalUrl(String devportalUrl) { @@ -255,29 +250,6 @@ public void setCrossTenantSubscriptionEnabled(Boolean crossTenantSubscriptionEna } - public SettingsDTO deployments(List deployments) { - - this.deployments = deployments; - return this; - } - - /** - * Get deployments - * @return deployments - **/ - @javax.annotation.Nullable - @ApiModelProperty(value = "") - - public List getDeployments() { - return deployments; - } - - - public void setDeployments(List deployments) { - this.deployments = deployments; - } - - @Override public boolean equals(Object o) { if (this == o) { @@ -294,13 +266,12 @@ public boolean equals(Object o) { Objects.equals(this.securityAuditProperties, settings.securityAuditProperties) && Objects.equals(this.externalStoresEnabled, settings.externalStoresEnabled) && Objects.equals(this.docVisibilityEnabled, settings.docVisibilityEnabled) && - Objects.equals(this.crossTenantSubscriptionEnabled, settings.crossTenantSubscriptionEnabled) && - Objects.equals(this.deployments, settings.deployments); + Objects.equals(this.crossTenantSubscriptionEnabled, settings.crossTenantSubscriptionEnabled); } @Override public int hashCode() { - return Objects.hash(devportalUrl, environment, scopes, monetizationAttributes, securityAuditProperties, externalStoresEnabled, docVisibilityEnabled, crossTenantSubscriptionEnabled, deployments); + return Objects.hash(devportalUrl, environment, scopes, monetizationAttributes, securityAuditProperties, externalStoresEnabled, docVisibilityEnabled, crossTenantSubscriptionEnabled); } @@ -316,7 +287,6 @@ public String toString() { sb.append(" externalStoresEnabled: ").append(toIndentedString(externalStoresEnabled)).append("\n"); sb.append(" docVisibilityEnabled: ").append(toIndentedString(docVisibilityEnabled)).append("\n"); sb.append(" crossTenantSubscriptionEnabled: ").append(toIndentedString(crossTenantSubscriptionEnabled)).append("\n"); - sb.append(" deployments: ").append(toIndentedString(deployments)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsageDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsageDTO.java index 8ef9e24168..5ebb1afa8a 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsageDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsageDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIInfoDTO.java index 11a6f76b9e..3af1372a84 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIResourceInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIResourceInfoDTO.java index d3b659b39a..fe337efe6e 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIResourceInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SharedScopeUsedAPIResourceInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriberInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriberInfoDTO.java index 0a868b9a58..c86b514bea 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriberInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriberInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionDTO.java index 606a5c4c0f..7ecd612196 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionListDTO.java index c2f187f6f3..bcf7a52ab6 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyAllOfDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyAllOfDTO.java index 34ca8444e0..837f385835 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyAllOfDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyAllOfDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyDTO.java index 73a33af43c..e8a9446eda 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyListDTO.java index 98252c9d6f..1d19298910 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionPolicyListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionThrottlePolicyPermissionDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionThrottlePolicyPermissionDTO.java index bb2a3d193d..1615b7281c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionThrottlePolicyPermissionDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/SubscriptionThrottlePolicyPermissionDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantDTO.java index 0ee5e17a9e..f6f96c5d89 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantListDTO.java index 7752f773e7..f598051b64 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TenantListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyDTO.java index c69bacf34d..1ce48c104c 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyListDTO.java index bc3d32e821..54ec3d14fb 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThreatProtectionPolicyListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitBaseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitBaseDTO.java index 12c3bb55c8..b2448c0da2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitBaseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitBaseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitDTO.java index e21ca2fdea..906ad36768 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottleLimitDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlePolicyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlePolicyDTO.java new file mode 100644 index 0000000000..098831b75a --- /dev/null +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlePolicyDTO.java @@ -0,0 +1,247 @@ +/* + * WSO2 API Manager - Publisher API + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * + * The version of the OpenAPI document: v2 + * Contact: architecture@wso2.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package org.wso2.am.integration.clients.publisher.api.v1.dto; + +import java.util.Objects; +import java.util.Arrays; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.annotations.SerializedName; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import com.fasterxml.jackson.annotation.JsonCreator; +/** +* ThrottlePolicyDTO +*/ + + +public class ThrottlePolicyDTO { + public static final String SERIALIZED_NAME_POLICY_ID = "policyId"; + @SerializedName(SERIALIZED_NAME_POLICY_ID) + private String policyId; + + public static final String SERIALIZED_NAME_POLICY_NAME = "policyName"; + @SerializedName(SERIALIZED_NAME_POLICY_NAME) + private String policyName; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "displayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + private String displayName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + private String description; + + public static final String SERIALIZED_NAME_IS_DEPLOYED = "isDeployed"; + @SerializedName(SERIALIZED_NAME_IS_DEPLOYED) + private Boolean isDeployed = false; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + protected String type; + + public ThrottlePolicyDTO() { + this.type = this.getClass().getSimpleName(); + } + + public ThrottlePolicyDTO policyId(String policyId) { + + this.policyId = policyId; + return this; + } + + /** + * Id of policy + * @return policyId + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "0c6439fd-9b16-3c2e-be6e-1086e0b9aa93", value = "Id of policy") + + public String getPolicyId() { + return policyId; + } + + + public void setPolicyId(String policyId) { + this.policyId = policyId; + } + + + public ThrottlePolicyDTO policyName(String policyName) { + + this.policyName = policyName; + return this; + } + + /** + * Name of policy + * @return policyName + **/ + @ApiModelProperty(example = "30PerMin", required = true, value = "Name of policy") + + public String getPolicyName() { + return policyName; + } + + + public void setPolicyName(String policyName) { + this.policyName = policyName; + } + + + public ThrottlePolicyDTO displayName(String displayName) { + + this.displayName = displayName; + return this; + } + + /** + * Display name of the policy + * @return displayName + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "30PerMin", value = "Display name of the policy") + + public String getDisplayName() { + return displayName; + } + + + public void setDisplayName(String displayName) { + this.displayName = displayName; + } + + + public ThrottlePolicyDTO description(String description) { + + this.description = description; + return this; + } + + /** + * Description of the policy + * @return description + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "Allows 30 request per minute", value = "Description of the policy") + + public String getDescription() { + return description; + } + + + public void setDescription(String description) { + this.description = description; + } + + + public ThrottlePolicyDTO isDeployed(Boolean isDeployed) { + + this.isDeployed = isDeployed; + return this; + } + + /** + * Indicates whether the policy is deployed successfully or not. + * @return isDeployed + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Indicates whether the policy is deployed successfully or not.") + + public Boolean isIsDeployed() { + return isDeployed; + } + + + public void setIsDeployed(Boolean isDeployed) { + this.isDeployed = isDeployed; + } + + + public ThrottlePolicyDTO type(String type) { + + this.type = type; + return this; + } + + /** + * Indicates the type of throttle policy + * @return type + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Indicates the type of throttle policy") + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ThrottlePolicyDTO throttlePolicy = (ThrottlePolicyDTO) o; + return Objects.equals(this.policyId, throttlePolicy.policyId) && + Objects.equals(this.policyName, throttlePolicy.policyName) && + Objects.equals(this.displayName, throttlePolicy.displayName) && + Objects.equals(this.description, throttlePolicy.description) && + Objects.equals(this.isDeployed, throttlePolicy.isDeployed) && + Objects.equals(this.type, throttlePolicy.type); + } + + @Override + public int hashCode() { + return Objects.hash(policyId, policyName, displayName, description, isDeployed, type); + } + + +@Override +public String toString() { +StringBuilder sb = new StringBuilder(); +sb.append("class ThrottlePolicyDTO {\n"); + sb.append(" policyId: ").append(toIndentedString(policyId)).append("\n"); + sb.append(" policyName: ").append(toIndentedString(policyName)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" isDeployed: ").append(toIndentedString(isDeployed)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); +sb.append("}"); +return sb.toString(); +} + +/** +* Convert the given object to string with each line indented by 4 spaces +* (except the first line). +*/ +private String toIndentedString(Object o) { +if (o == null) { +return "null"; +} +return o.toString().replace("\n", "\n "); +} + +} + diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyDTO.java index 6399a81755..11621144e0 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyListDTO.java index 8e3b59928a..87149c2cad 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/ThrottlingPolicyListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicDTO.java index 360773e800..0e5d6864fd 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicListDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicListDTO.java index f65d280c57..cec56114d3 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicListDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/TopicListDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/VHostDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/VHostDTO.java index 8902ae0c5e..45a8534fc2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/VHostDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/VHostDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLInfoDTO.java index b932ea6d99..ea1fe574a5 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseDTO.java index dfb81b17b2..33c141a6d3 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoDTO.java index 7869dd8445..28002dc7d1 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoEndpointsDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoEndpointsDTO.java index 5a2b4016f5..edebe03762 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoEndpointsDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WSDLValidationResponseWsdlInfoEndpointsDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WebsubSubscriptionConfigurationDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WebsubSubscriptionConfigurationDTO.java index 892bc67eb7..a5a0a55330 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WebsubSubscriptionConfigurationDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WebsubSubscriptionConfigurationDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com @@ -29,6 +29,10 @@ */ public class WebsubSubscriptionConfigurationDTO { + public static final String SERIALIZED_NAME_ENABLE = "enable"; + @SerializedName(SERIALIZED_NAME_ENABLE) + private Boolean enable = false; + public static final String SERIALIZED_NAME_SECRET = "secret"; @SerializedName(SERIALIZED_NAME_SECRET) private String secret; @@ -42,6 +46,29 @@ public class WebsubSubscriptionConfigurationDTO { private String signatureHeader; + public WebsubSubscriptionConfigurationDTO enable(Boolean enable) { + + this.enable = enable; + return this; + } + + /** + * Toggle enable WebSub subscription configuration + * @return enable + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "Toggle enable WebSub subscription configuration") + + public Boolean isEnable() { + return enable; + } + + + public void setEnable(Boolean enable) { + this.enable = enable; + } + + public WebsubSubscriptionConfigurationDTO secret(String secret) { this.secret = secret; @@ -120,14 +147,15 @@ public boolean equals(Object o) { return false; } WebsubSubscriptionConfigurationDTO websubSubscriptionConfiguration = (WebsubSubscriptionConfigurationDTO) o; - return Objects.equals(this.secret, websubSubscriptionConfiguration.secret) && + return Objects.equals(this.enable, websubSubscriptionConfiguration.enable) && + Objects.equals(this.secret, websubSubscriptionConfiguration.secret) && Objects.equals(this.signingAlgorithm, websubSubscriptionConfiguration.signingAlgorithm) && Objects.equals(this.signatureHeader, websubSubscriptionConfiguration.signatureHeader); } @Override public int hashCode() { - return Objects.hash(secret, signingAlgorithm, signatureHeader); + return Objects.hash(enable, secret, signingAlgorithm, signatureHeader); } @@ -135,6 +163,7 @@ public int hashCode() { public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class WebsubSubscriptionConfigurationDTO {\n"); + sb.append(" enable: ").append(toIndentedString(enable)).append("\n"); sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); sb.append(" signingAlgorithm: ").append(toIndentedString(signingAlgorithm)).append("\n"); sb.append(" signatureHeader: ").append(toIndentedString(signatureHeader)).append("\n"); diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WorkflowResponseDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WorkflowResponseDTO.java index cb9c5ce489..152f24d6be 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WorkflowResponseDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/WorkflowResponseDTO.java @@ -1,6 +1,6 @@ /* * WSO2 API Manager - Publisher API - * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/token ``` **Sample request** ``` curl https://localhost:8243/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + * This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types in the payload. A Sample payload is shown below. ``` { \"callbackUrl\":\"www.google.lk\", \"clientName\":\"rest_api_publisher\", \"owner\":\"admin\", \"grantType\":\"client_credentials password refresh_token\", \"saasApp\":true } ``` Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the base64 encoded admin username and password. **Format of the request** ``` curl -X POST -H \"Authorization: Basic Base64(admin_username:admin_password)\" -H \"Content-Type: application/json\" \\ -d @payload.json https://:/client-registration/v0.17/register ``` **Sample request** ``` curl -X POST -H \"Authorization: Basic YWRtaW46YWRtaW4=\" -H \"Content-Type: application/json\" \\ -d @payload.json https://localhost:9443/client-registration/v0.17/register ``` Following is a sample response after invoking the above curl. ``` { \"clientId\": \"fOCi4vNJ59PpHucC2CAYfYuADdMa\", \"clientName\": \"rest_api_publisher\", \"callBackURL\": \"www.google.lk\", \"clientSecret\": \"a4FwHlq0iCIKVs2MPIIDnepZnYMa\", \"isSaasApplication\": true, \"appOwner\": \"admin\", \"jsonString\": \"{\\\"grant_types\\\":\\\"client_credentials password refresh_token\\\",\\\"redirect_uris\\\":\\\"www.google.lk\\\",\\\"client_name\\\":\\\"rest_api123\\\"}\", \"jsonAppAttribute\": \"{}\", \"tokenType\": null } ``` Next you must use the above client id and secret to obtain the access token. We will be using the password grant type for this, you can use any grant type you desire. You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section of this document and scope for each resource is given in **authorization** section of resource documentation. Following is the format of the request if you are using the password grant type. ``` curl -k -d \"grant_type=password&username=&password=\" \\ -H \"Authorization: Basic base64(cliet_id:client_secret)\" \\ https://:/oauth2/token ``` **Sample request** ``` curl https://localhost:9443/oauth2/token -k \\ -H \"Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h\" \\ -d \"grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create\" ``` Shown below is a sample response to the above request. ``` { \"access_token\": \"e79bda48-3406-3178-acce-f6e4dbdcbb12\", \"refresh_token\": \"a757795d-e69f-38b8-bd85-9aded677a97c\", \"scope\": \"apim:api_create apim:api_view\", \"token_type\": \"Bearer\", \"expires_in\": 3600 } ``` Now you have a valid access token, which you can use to invoke an API. Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. If you use a different authentication mechanism, this process may change. # Try out in Postman If you want to try-out the embedded postman collection with \"Run in Postman\" option, please follow the guidelines listed below. * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. * Make sure you have an API Manager instance up and running. * Update the `basepath` parameter to match the hostname and port of the APIM instance. [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) * * The version of the OpenAPI document: v2 * Contact: architecture@wso2.com diff --git a/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml b/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml index 4adf351002..7d8eee540d 100644 --- a/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml +++ b/modules/integration/tests-common/clients/publisher/src/main/resources/publisher-api.yaml @@ -19,7 +19,7 @@ info: This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. # Authentication - Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking + The Publisher REST API is protected using OAuth2 and access control is achieved through scopes. Before you start invoking the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps that you will need to follow to obtain an access token. First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types @@ -67,11 +67,11 @@ info: ``` curl -k -d "grant_type=password&username=&password=" \ -H "Authorization: Basic base64(cliet_id:client_secret)" - \ https://:/token + \ https://:/oauth2/token ``` **Sample request** ``` - curl https://localhost:8243/token -k \ + curl https://localhost:9443/oauth2/token -k \ -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \ -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create" ``` @@ -138,14 +138,13 @@ paths: "provider:wso2" will match an API if the provider of the API contains "wso2". "provider:"wso2"" will match an API if the provider of the API is exactly "wso2". "status:PUBLISHED" will match an API if the API is in PUBLISHED state. - "label:external" will match an API if it contains a Microgateway label called "external". Also you can use combined modifiers Eg. name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. Supported attribute modifiers are [**version, context, name, status, - description, subcontext, doc, provider, label**] + description, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. @@ -505,6 +504,13 @@ paths: $ref: '#/components/responses/NotFound' 500: $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/ecb5b300-422d-4ee8-88d2-364a0a122238/reimport-service"' /apis/{apiId}/swagger: get: @@ -1402,7 +1408,7 @@ paths: get: tags: - API Revisions - summary: List available revisions of an API + summary: List Revisions description: | List available revisions of an API operationId: getAPIRevisions @@ -1425,12 +1431,13 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' #-------------------------------------------- # Create a new API revision @@ -1438,7 +1445,7 @@ paths: post: tags: - API Revisions - summary: Create a new API revision + summary: Create API Revision description: | Create a new API revision operationId: createAPIRevision @@ -1465,13 +1472,14 @@ paths: $ref: '#/components/responses/PreconditionFailed' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: application/json" -d @data.json - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' ###################################################### # The "API Revisions" individual resource API @@ -1484,7 +1492,7 @@ paths: get: tags: - API Revisions - summary: Retrieve a revision of an API + summary: Retrieve Revision description: | Retrieve a revision of an API operationId: getAPIRevision @@ -1504,11 +1512,12 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' #-------------------------------------------- # Delete a revision @@ -1516,7 +1525,7 @@ paths: delete: tags: - API Revisions - summary: Delete a revision of an API + summary: Delete Revision description: | Delete a revision of an API operationId: deleteAPIRevision @@ -1540,22 +1549,22 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export x-code-samples: - lang: Curl source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /apis/{apiId}/deploy-revision: + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + /apis/{apiId}/deployments: #-------------------------------------------- # List available deployed revision deployment details of an API #-------------------------------------------- get: tags: - API Revisions - summary: List available deployed revision deployment details of an API + summary: List Deployments description: | List available deployed revision deployment details of an API operationId: getAPIRevisionDeployments @@ -1574,19 +1583,61 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments"' + + /apis/{apiId}/deployments/{deploymentId}: + #-------------------------------------------- + # Change Display On Devportal Field + #-------------------------------------------- + put: + tags: + - API Revisions + summary: Update Deployment + description: | + Update deployment devportal visibility + operationId: updateAPIDeployment + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/deploymentId' + requestBody: + description: Deployment object that needs to be updated + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + responses: + 200: + description: | + Created. + Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -d @data.json + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments/UHJvZHVjdGlvbiBhbmQgU2FuZGJveA"' + /apis/{apiId}/deploy-revision: #-------------------------------------------- # Deploy a revision #-------------------------------------------- post: tags: - API Revisions - summary: Deploy a revision + summary: Deploy Revision description: | Deploy a revision operationId: deployAPIRevision @@ -1603,9 +1654,6 @@ paths: $ref: '#/components/schemas/APIRevisionDeployment' responses: 200: - description: | - OK. - 201: description: | Created. Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. @@ -1615,15 +1663,18 @@ paths: type: array items: $ref: '#/components/schemas/APIRevisionDeployment' + 400: + $ref: '#/components/responses/BadRequest' 404: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' /apis/{apiId}/undeploy-revision: #-------------------------------------------- @@ -1632,9 +1683,9 @@ paths: post: tags: - API Revisions - summary: Un-Deploy a revision + summary: UnDeploy Revision description: | - Un-Deploy a revision + UnDeploy a revision operationId: undeployAPIRevision parameters: - $ref: '#/components/parameters/apiId' @@ -1667,28 +1718,31 @@ paths: type: array items: $ref: '#/components/schemas/APIRevisionDeployment' + 400: + $ref: '#/components/responses/BadRequest' 404: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_import_export x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' /apis/{apiId}/restore-revision: #-------------------------------------------------------- - # Restore a revision to the working copy of the API + # Restore a revision to the current API of the API #-------------------------------------------------------- post: tags: - API Revisions - summary: Restore a revision + summary: Restore API Revision description: | - Restore a revision to the working copy of the API + Restore a revision to the current API of the API operationId: restoreAPIRevision parameters: - $ref: '#/components/parameters/apiId' @@ -1706,11 +1760,12 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' /apis/import-service: post: @@ -1726,6 +1781,7 @@ paths: schema: type: string description: ID of service that should be imported from Service Catalog + example: Pizzashack-1.0.0 requestBody: content: application/json: @@ -1756,6 +1812,13 @@ paths: $ref: '#/components/responses/NotFound' 500: $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-service?serviceKey=Pizzashack-1.0.0"' /apis/{apiId}/comments: get: @@ -1780,13 +1843,13 @@ paths: application/json: schema: $ref: '#/components/schemas/CommentList' - 401: - $ref: '#/components/responses/Unauthorized' - 406: - $ref: '#/components/responses/NotAcceptable' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - - apim:comment_view + - apim:comment_view x-code-samples: - lang: Curl source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments" @@ -1810,6 +1873,7 @@ paths: properties: content: type: string + maxLength: 512 description: | Content of the comment example: This is a comment @@ -1846,8 +1910,12 @@ paths: $ref: '#/components/responses/BadRequest' 401: $ref: '#/components/responses/Unauthorized' + 404: + $ref: '#/components/responses/NotFound' 415: $ref: '#/components/responses/UnsupportedMediaType' + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - apim:comment_write @@ -1894,20 +1962,17 @@ paths: application/json: schema: $ref: '#/components/schemas/Comment' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - content: {} 401: $ref: '#/components/responses/Unauthorized' 404: $ref: '#/components/responses/NotFound' 406: $ref: '#/components/responses/NotAcceptable' + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - - apim:comment_view + - apim:comment_view x-code-samples: - lang: Curl source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" @@ -1933,6 +1998,7 @@ paths: properties: content: type: string + maxLength: 512 description: | Content of the comment example: This is a comment @@ -1953,7 +2019,7 @@ paths: Entity Tag of the response resource. Used by caches, or in conditional request. schema: type: string - Location: #??? + Location: description: | Location to the newly created Comment. schema: @@ -1966,16 +2032,20 @@ paths: $ref: '#/components/responses/BadRequest' 401: $ref: '#/components/responses/Unauthorized' + 403: + $ref: '#/components/responses/Forbidden' 404: $ref: '#/components/responses/NotFound' 415: $ref: '#/components/responses/UnsupportedMediaType' + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - apim:comment_write x-code-samples: - lang: Curl - source: 'curl -k -X PUT -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + source: 'curl -k -X PATCH -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"' delete: @@ -1997,8 +2067,17 @@ paths: content: {} 401: $ref: '#/components/responses/Unauthorized' + 403: + $ref: '#/components/responses/Forbidden' 404: $ref: '#/components/responses/NotFound' + 405: + description: | + MethodNotAllowed. + Request method is known by the server but is not supported by the target resource. + content: {} + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - apim:comment_write @@ -2046,23 +2125,20 @@ paths: application/json: schema: $ref: '#/components/schemas/CommentList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - content: {} 401: $ref: '#/components/responses/Unauthorized' 404: $ref: '#/components/responses/NotFound' 406: $ref: '#/components/responses/NotAcceptable' + 500: + $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - - apim:comment_view + - apim:comment_view x-code-samples: - lang: Curl - source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" + source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4/replies" /apis/import-openapi: post: @@ -2090,6 +2166,9 @@ paths: additionalProperties: type: string description: Additional attributes specified as a stringified JSON with API's schema + inlineAPIDefinition: + type: string + description: Inline content of the OpenAPI definition responses: 201: description: | @@ -2223,7 +2302,7 @@ paths: post: tags: - APIs - summary: Import API Definition + summary: Import a GraphQL SDL description: | This operation can be used to create api from api definition.APIMgtDAOTest @@ -2320,6 +2399,9 @@ paths: type: string description: OpenAPI definition as a file format: binary + inlineAPIDefinition: + type: string + description: Inline content of the OpenAPI definition responses: 200: description: | @@ -2502,7 +2584,7 @@ paths: post: tags: - Validation - summary: Validate GraphQL API Definition and Retrieve a Summary + summary: Validate a GraphQL SDL description: | This operation can be used to validate a graphQL definition and retrieve a summary. requestBody: @@ -4270,6 +4352,7 @@ paths: security: - OAuth2Security: - apim:api_import_export + - apim:admin x-code-samples: - lang: Curl source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" @@ -4582,25 +4665,25 @@ paths: "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api"' ###################################################### - # The "Individual Throttling Tier" resource APIs + # The "Subscription Throttling Based on Quota Type" resource APIs ###################################################### - /throttling-policies/{policyLevel}/{policyName}: + /throttling-policies/streaming/subscription: get: tags: - Throttling Policies - summary: Get Details of a Policy + summary: Get streaming throttling policies description: | - This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. - operationId: getThrottlingPolicyByName + This operation can be used to list the available streaming subscription policies + operationId: getSubscriptionThrottlingPolicies parameters: - - $ref: '#/components/parameters/policyName' - - $ref: '#/components/parameters/policyLevel' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Tier returned + List of subscription policies returned. headers: ETag: description: | @@ -4608,28 +4691,19 @@ paths: Used by caches, or in conditional requests (Will be supported in future). schema: type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Content-Type: - description: | - The content type of the body. + description: The content type of the body. schema: type: string content: application/json: schema: - $ref: '#/components/schemas/ThrottlingPolicy' + $ref: '#/components/schemas/SubscriptionPolicyList' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). content: {} - 404: - $ref: '#/components/responses/NotFound' 406: $ref: '#/components/responses/NotAcceptable' security: @@ -4638,28 +4712,28 @@ paths: x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/subscription?tierQuotaType=RequestCountLimit"' ###################################################### - # The "Subscription Throttling Based on Quota Type" resource APIs + # The "Individual Throttling Tier" resource APIs ###################################################### - /throttling-policies/streaming/subscription: + /throttling-policies/{policyLevel}/{policyName}: get: tags: - Throttling Policies - summary: Get streaming throttling policies + summary: Get Details of a Policy description: | - This operation can be used to list the available streaming subscription policies - operationId: getSubscriptionThrottlingPolicies + This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. + operationId: getThrottlingPolicyByName parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/policyName' + - $ref: '#/components/parameters/policyLevel' - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - List of subscription policies returned. + Tier returned headers: ETag: description: | @@ -4667,19 +4741,28 @@ paths: Used by caches, or in conditional requests (Will be supported in future). schema: type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Content-Type: - description: The content type of the body. + description: | + The content type of the body. schema: type: string content: application/json: schema: - $ref: '#/components/schemas/SubscriptionPolicyList' + $ref: '#/components/schemas/ThrottlingPolicy' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). content: {} + 404: + $ref: '#/components/responses/NotFound' 406: $ref: '#/components/responses/NotAcceptable' security: @@ -4688,7 +4771,7 @@ paths: x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/streaming/subscription"' + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' ###################################################### # The "Mediation Policy Collection" resource APIs @@ -6378,7 +6461,7 @@ paths: get: tags: - API Product Revisions - summary: List available revisions of an API Product + summary: List Revisions description: | List available revisions of an API Product operationId: getAPIProductRevisions @@ -6401,6 +6484,7 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_product_import_export x-code-samples: @@ -6441,6 +6525,7 @@ paths: $ref: '#/components/responses/PreconditionFailed' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl @@ -6459,7 +6544,7 @@ paths: get: tags: - API Product Revisions - summary: Retrieve a revision of an API Product + summary: Retrieve Revision description: | Retrieve a revision of an API Product operationId: getAPIProductRevision @@ -6479,6 +6564,7 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl @@ -6491,7 +6577,7 @@ paths: delete: tags: - API Product Revisions - summary: Delete a revision of an API Product + summary: Delete Revision description: | Delete a revision of an API Product operationId: deleteAPIProductRevision @@ -6515,21 +6601,21 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - /api-products/{apiProductId}/deploy-revision: - + /api-products/{apiProductId}/deployments: #-------------------------------------------- # List available deployed revision deployment details of an API Product #-------------------------------------------- get: tags: - API Product Revisions - summary: List available deployed revision deployment details of an API Product + summary: List Deployments description: | List available deployed revision deployment details of an API Product operationId: getAPIProductRevisionDeployments @@ -6548,21 +6634,63 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments"' + + /api-products/{apiProductId}/deployments/{deploymentId}: + #-------------------------------------------- + # Change Display On Devportal Field + #-------------------------------------------- + put: + tags: + - API Product Revisions + summary: Update Deployment + description: | + Update deployment devportal visibility + operationId: updateAPIProductDeployment + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/deploymentId' + requestBody: + description: Deployment object that needs to be updated + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + responses: + 200: + description: | + Created. + Successful response with the newly updated APIRevisionDeployment List object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -d @data.json + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deployments/UHJvZHVjdGlvbiBhbmQgU2FuZGJveA"' + /api-products/{apiProductId}/deploy-revision: #-------------------------------------------- # Deploy a revision #-------------------------------------------- post: tags: - API Product Revisions - summary: Deploy a revision + summary: Deploy Revision description: | - Deploy a revision + Deploy an API Product Revision operationId: deployAPIProductRevision parameters: - $ref: '#/components/parameters/apiProductId' @@ -6589,10 +6717,13 @@ paths: type: array items: $ref: '#/components/schemas/APIRevisionDeployment' + 400: + $ref: '#/components/responses/BadRequest' 404: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl @@ -6606,9 +6737,9 @@ paths: post: tags: - API Product Revisions - summary: Un-Deploy a revision + summary: UnDeploy Revision description: | - Un-Deploy a revision + UnDeploy an API Product Revision operationId: undeployAPIProductRevision parameters: - $ref: '#/components/parameters/apiProductId' @@ -6641,10 +6772,13 @@ paths: type: array items: $ref: '#/components/schemas/APIRevisionDeployment' + 400: + $ref: '#/components/responses/BadRequest' 404: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish - apim:api_product_import_export x-code-samples: @@ -6655,14 +6789,14 @@ paths: /api-products/{apiProductId}/restore-revision: #-------------------------------------------------------- - # Restore a revision to the working copy of the API Product + # Restore a revision to the Current API of the API Product #-------------------------------------------------------- post: tags: - API Product Revisions - summary: Restore a revision + summary: Restore Revision description: | - Restore a revision to the working copy of the API Product + Restore a revision to the Current API of the API Product operationId: restoreAPIProductRevision parameters: - $ref: '#/components/parameters/apiProductId' @@ -6680,6 +6814,7 @@ paths: $ref: '#/components/responses/NotFound' security: - OAuth2Security: + - apim:api_create - apim:api_publish x-code-samples: - lang: Curl @@ -7037,59 +7172,53 @@ paths: x-examples: $ref: docs/examples/tenants/tenants.yaml - #################################################### - # Publisher Alerts management REST API - #################################################### - /alert-types: + ###################################################### + # The "API Category Collection" resource API + ###################################################### + /api-categories: get: tags: - - Alerts - summary: | - Get the list of API Publisher alert types. + - API Category (Collection) + summary: Get all API categories description: | - This operation is used to get the list of supportd alert types for the 'publisher' agent. - operationId: getPublisherAlertTypes + Get all API categories responses: 200: description: | OK. - The list of publisher alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string + Categories returned content: application/json: schema: - $ref: '#/components/schemas/AlertTypesList' - 500: - $ref: '#/components/responses/InternalServerError' + $ref: '#/components/schemas/APICategoryList' security: - OAuth2Security: - - apim:pub_alert_manage + - apim:api_view x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-types"' - x-examples: - $ref: docs/examples/alerts/alerts.yaml#/get + "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' + operationId: getAllAPICategories - /alert-subscriptions: + ###################################################### + # The "Scopes" resource APIs + ###################################################### + /scopes: get: tags: - - Alert Subscriptions - summary: | - Get the List of API Publisher Alert Types Subscribed by the User + - Scopes + summary: Get All Available Shared Scopes description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: getSubscribedAlertTypes + This operation can be used to get all the available Shared Scopes. + operationId: getSharedScopes + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' responses: 200: description: | OK. - The list of subscribed alert types are returned. + Shared Scope list is returned. headers: Content-Type: description: | @@ -7099,315 +7228,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/AlertsInfo' + $ref: '#/components/schemas/ScopeList' 500: $ref: '#/components/responses/InternalServerError' security: - OAuth2Security: - - apim:pub_alert_manage + - apim:api_view x-code-samples: - lang: Curl source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/get + "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' - put: + post: tags: - - Alert Subscriptions - summary: | - Subscribe to the Selected Tlert types by the User + - Scopes + summary: Add a New Shared Scope description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: subscribeToAlerts + This operation can be used to add a new Shared Scope. + operationId: addSharedScope requestBody: - description: The alerts list and the email list to subscribe. + description: Scope object that needs to be added content: application/json: schema: - $ref: '#/components/schemas/AlertsInfo' - required: true - responses: - 201: - description: | - OK. - Successful response with the newly subscribed alerts. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfoResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/put - - delete: - tags: - - Alert Subscriptions - summary: | - Unsubscribe User from All the Alert Types - description: | - This operation is used to unsubscribe the respective user from all the alert types. - operationId: unsubscribeAllAlerts - responses: - 200: - description: | - OK. - The user is unsubscribed from the alerts successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/delete - - /alerts/{alertType}/configurations: - get: - tags: - - Alert Configuration - summary: | - Get All AbnormalRequestsPerMin Alert Configurations - description: | - This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - operationId: getAllAlertConfigs - parameters: - - $ref: '#/components/parameters/alertType' - responses: - 200: - description: | - OK. - The Developer Portal alert configuration. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alerts/{alertType}/configurations"' - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/get - - /alerts/{alertType}/configurations/{configurationId}: - put: - tags: - - Alert Configuration - summary: | - Add AbnormalRequestsPerMin Alert Configurations. - description: | - This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - operationId: addAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - requestBody: - description: Configuration for AbnormalRequestCount alert type - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigInfo' - required: true - responses: - 201: - description: | - Created. - Successful response with newly created object as entity. - Location header contains URL of newly created entity. - headers: - Location: - description: | - The location of the newly created entity. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfig' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/put - - delete: - tags: - - Alert Configuration - summary: | - Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - description: | - This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - operationId: deleteAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - responses: - 200: - description: | - OK. - The alert config is deleted successfully. - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/delete - - ###################################################### - # The "Label Collection" resource API - ###################################################### - /labels: - get: - tags: - - Label Collection - summary: Get all Registered Labels - description: | - Get all registered Labels - responses: - 200: - description: | - OK. - Labels returned - content: - application/json: - schema: - $ref: '#/components/schemas/LabelList' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/labels"' - operationId: getLabels - - ###################################################### - # The "API Category Collection" resource API - ###################################################### - /api-categories: - get: - tags: - - API Category (Collection) - summary: Get all API categories - description: | - Get all API categories - responses: - 200: - description: | - OK. - Categories returned - content: - application/json: - schema: - $ref: '#/components/schemas/APICategoryList' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' - operationId: getAllAPICategories - - ###################################################### - # The "Scopes" resource APIs - ###################################################### - /scopes: - get: - tags: - - Scopes - summary: Get All Available Shared Scopes - description: | - This operation can be used to get all the available Shared Scopes. - operationId: getSharedScopes - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - 200: - description: | - OK. - Shared Scope list is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ScopeList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' - - post: - tags: - - Scopes - summary: Add a New Shared Scope - description: | - This operation can be used to add a new Shared Scope. - operationId: addSharedScope - requestBody: - description: Scope object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' + $ref: '#/components/schemas/Scope' required: true responses: 201: @@ -7626,87 +7470,6 @@ paths: "https://127.0.0.1:9443/api/am/publisher/v2/key-managers"' operationId: getAllKeyManagers - ###################################################### - # The "Deployments" resource APIs - ###################################################### - /deployments: - get: - tags: - - Deployments - summary: Retrieve Deployment Environments Details - description: | - This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. - - With that you can deploy an API to selected cloud environments. - operationId: deploymentsGet - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/deployments"' - - /apis/{apiId}/deployments: - get: - tags: - - DeploymentStatus - summary: Retrieve Deployment Status Details - description: | - This operation can be used to retrieve the status of deployments in cloud clusters. - - With that you can get the status of the deployed APIs in cloud environments. - operationId: deploymentsGetStatus - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentStatusList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/92bc1330-1848-4fe8-b992-c792186c212e/deployments/"' - /apis/validate-asyncapi: post: tags: @@ -7967,12 +7730,16 @@ components: example : 2021-02-12-19:57:25 category: type: string + readOnly: true default: general + example : general parentCommentId: type: string + readOnly: true example: 6f38aea2-f41e-4ac9-b3f2-a9493d00ba97 entryPoint: type: string + readOnly: true enum: [devPortal, publisher] commenterInfo: $ref: '#/components/schemas/CommenterInfo' @@ -7984,11 +7751,13 @@ components: properties: count: type: integer + readOnly: true description: | Number of Comments returned. example: 1 list: type: array + readOnly: true items: $ref: '#/components/schemas/Comment' pagination: @@ -8076,15 +7845,12 @@ components: type: array items: type: string - websubSubscriptionConfiguration: - type: object - properties: - secret: - type: string - signingAlgorithm: - type: string - signatureHeader: - type: string + createdTime: + type: string + example : 2021-02-11 09:57:25 + updatedTime: + type: string + example : 2021-02-11 09:57:25 Topic: title: Topic object @@ -8102,7 +7868,7 @@ components: name: maxLength: 50 minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' + pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+\[\]\/]*$)' type: string example: PizzaShackAPI mode: @@ -8145,7 +7911,7 @@ components: name: maxLength: 50 minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' + pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+\[\]\/]*$)' type: string example: PizzaShackAPI description: @@ -8161,7 +7927,7 @@ components: maxLength: 30 minLength: 1 type: string - pattern: '^[^~!@#;:%^*()+={}|\\<>"'',&/$]+$' + pattern: '^[^~!@#;:%^*()+={}|\\<>"'',&/$\[\]\s+\/]+$' example: 1.0.0 provider: maxLength: 50 @@ -8268,6 +8034,7 @@ components: - apim:api_publish authorizationHeader: type: string + pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' description: | Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified in tenant or system level will be used. @@ -8308,8 +8075,6 @@ components: example: [] items: type: string - endpointSecurity: - $ref: '#/components/schemas/APIEndpointSecurity' gatewayEnvironments: type: array description: | @@ -8320,21 +8085,6 @@ components: type: string x-otherScopes: - apim:api_publish - deploymentEnvironments: - type: array - description: | - List of selected deployment environments and clusters - items: - $ref: '#/components/schemas/DeploymentEnvironments' - x-otherScopes: - - apim:api_publish - labels: - type: array - description: | - Labels of micro-gateway environments attached to the API. - example: [] - items: - type: string mediationPolicies: type: array example: @@ -8398,7 +8148,8 @@ components: items: type: string businessInformation: - $ref: '#/components/schemas/APIBusinessInformation' + allOf: + - $ref: '#/components/schemas/APIBusinessInformation' x-otherScopes: - apim:api_publish corsConfiguration: @@ -8576,6 +8327,8 @@ components: outdated: type: boolean example: false + advertiseInfo: + $ref: '#/components/schemas/AdvertiseInfo' x-scopes: - apim:api_create - apim:api_import_export @@ -8588,19 +8341,25 @@ components: properties: displayName: type: string + readOnly: true example: REVISION 1 id: type: string + readOnly: true example: c26b2b9b-4632-4ca4-b6f3-521c8863990c description: + maxLength: 255 + minLength: 0 type: string example: removed a post resource createdTime: + readOnly: true type: string apiInfo: $ref: '#/components/schemas/APIRevisionAPIInfo' deploymentInfo: type: array + readOnly: true items: $ref: '#/components/schemas/APIRevisionDeployment' @@ -8647,9 +8406,13 @@ components: title: APIRevisionDeployment Info object with basic API deployment details properties: revisionUuid: + maxLength: 255 + minLength: 0 type: string example: c26b2b9b-4632-4ca4-b6f3-521c8863990c name: + maxLength: 255 + minLength: 1 type: string example: default vhost: @@ -8663,6 +8426,7 @@ components: type: boolean example: true deployedTime: + readOnly: true type: string AuditReport: @@ -9444,6 +9208,23 @@ components: type: string description: Properties of a tier plan which are related to monetization example: {} + SubscriptionPolicyList: + title: Subscription policy list + type: object + properties: + count: + type: integer + description: | + Number of Tiers returned. + example: 1 + list: + type: array + description: | + Array of SubscriptionPolicies + items: + $ref: '#/components/schemas/SubscriptionPolicy' + pagination: + $ref: '#/components/schemas/Pagination' SubscriptionList: title: Subscription List type: object @@ -9486,6 +9267,54 @@ components: - ON_HOLD - REJECTED - TIER_UPDATE_PENDING + ThrottlePolicy: + title: Generic Throttling Policy + required: + - policyName + type: object + properties: + policyId: + type: string + description: Id of policy + readOnly: true + example: 0c6439fd-9b16-3c2e-be6e-1086e0b9aa93 + policyName: + maxLength: 60 + minLength: 1 + type: string + description: Name of policy + example: 30PerMin + displayName: + type: string + description: Display name of the policy + example: 30PerMin + maxLength: 512 + description: + maxLength: 1024 + type: string + description: Description of the policy + example: Allows 30 request per minute + isDeployed: + type: boolean + description: Indicates whether the policy is deployed successfully or not. + default: false + type: + type: string + description: Indicates the type of throttle policy + discriminator: + propertyName: type + GraphQLQuery: + title: GraphQL Query + type: object + properties: + graphQLMaxComplexity: + type: integer + description: Maximum Complexity of the GraphQL query + example: 400 + graphQLMaxDepth: + type: integer + description: Maximum Depth of the GraphQL query + example: 10 ThrottleLimitBase: title: Throttle Limit Base required: @@ -9589,23 +9418,6 @@ components: description: Maximum number of events allowed format: int64 example: 3000 - SubscriptionPolicyList: - title: Subscription policy list - type: object - properties: - count: - type: integer - description: | - Number of Tiers returned. - example: 1 - list: - type: array - description: | - Array of SubscriptionPolicies - items: - $ref: '#/components/schemas/SubscriptionPolicy' - pagination: - $ref: '#/components/schemas/Pagination' SubscriptionPolicy: title: Subscription Throttling Policy allOf: @@ -9822,8 +9634,6 @@ components: showInApiConsole: type: boolean example: true - endpoints: - $ref: '#/components/schemas/EnvironmentEndpoints' vhosts: type: array items: @@ -9841,26 +9651,6 @@ components: type: array items: $ref: '#/components/schemas/Environment' - EnvironmentEndpoints: - title: Environment Endpoints - type: object - properties: - http: - type: string - description: HTTP environment URL - example: http://localhost:8280 - https: - type: string - description: HTTPS environment URL - example: https://localhost:8243 - ws: - type: string - description: WS environment URL - example: http://localhost:9099 - wss: - type: string - description: WSS environment URL - example: https://localhost:8099 VHost: title: Virtual Host type: object @@ -9907,22 +9697,6 @@ components: type: integer format: int64 example: 1000 - APIEndpointSecurity: - type: object - properties: - type: - type: string - description: Accepts one of the following, basic or digest. - example: BASIC - enum: - - BASIC - - DIGEST - username: - type: string - example: admin - password: - type: string - example: password APIBusinessInformation: type: object properties: @@ -9945,6 +9719,10 @@ components: WebsubSubscriptionConfiguration: type: object properties: + enable: + type: boolean + default: false + description: Toggle enable WebSub subscription configuration secret: type: string description: Secret key to be used for subscription @@ -10387,38 +10165,6 @@ components: type: string example: Gold description: Meta data of certificate - Label: - title: Label - required: - - name - type: object - properties: - name: - type: string - example: marketing_store - description: - type: string - example: Public microgateway for marketing - access_urls: - type: array - example: https://localhost:9095 - items: - type: string - LabelList: - title: Label List - type: object - properties: - count: - type: integer - description: | - Number of Labels returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Label' - pagination: - $ref: '#/components/schemas/Pagination' LifecycleState: title: Lifecycle State type: object @@ -10813,6 +10559,7 @@ components: - INLINE - URL - FILE + - MARKDOWN sourceUrl: type: string example: "" @@ -10966,10 +10713,6 @@ components: Is Cross Tenant Subscriptions Enabled example: false default: false - deployments: - type: array - items: - $ref: '#/components/schemas/Deployments' SecurityAuditAttribute: title: SecurityAuditAttributeDTO type: object @@ -11079,118 +10822,19 @@ components: $ref: '#/components/schemas/Tenant' pagination: $ref: '#/components/schemas/Pagination' - AlertTypesList: - title: Alert Types List - type: object - properties: - count: - type: integer - description: The number of alerts - example: 3 - alerts: - type: array - items: - $ref: '#/components/schemas/AlertType' - AlertType: - title: Alert Type + AdvertiseInfo: + title: API Advertise info object with advertise details type: object properties: - id: - type: integer - description: The alert Id - example: 1 - name: - type: string - description: The name of the alert. - example: AbnormalRequestTime - requireConfiguration: + advertised: type: boolean - description: Whether the alert type require additional configurations. example: true - Alert: - title: Alert - type: object - properties: - id: - type: integer - description: The alert Id - example: 1 - name: + originalDevPortalUrl: type: string - description: The name of the alert. - example: AbnormalRequestsPerMin - configuration: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertsInfo: - title: Alerts Info - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: - type: string - AlertsInfoResponse: - title: Alerts Info Response - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: - type: string - failedConfigurations: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfigList: - title: Alert Configuration List - type: object - properties: - count: - type: integer - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfig: - title: Alert Configuration - type: object - properties: - configurationId: + example: https://localhost:9443/devportal + apiOwner: type: string - description: The alert config subscription id. - example: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - configuration: - type: object - additionalProperties: - type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - AlertConfigInfo: - title: Alert Configuration Info - type: object - additionalProperties: - type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" + example: admin APICategory: title: API Category required: @@ -11276,135 +10920,6 @@ components: type: integer format: int32 example: 3600 - DeploymentList: - title: Deployment List - type: object - properties: - count: - type: integer - description: | - Number of deployment clusters returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Deployments' - Deployments: - title: Deployments - required: - - clusters - - name - type: object - properties: - name: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterInfo' - DeploymentClusterInfo: - title: DeploymentClusterInfo - required: - - accessURL - - clusterName - - displayName - - properties - type: object - properties: - clusterName: - type: string - example: minikube - accessURL: - type: string - example: https://api.com - displayName: - type: string - example: kubernetes-minikube - properties: - type: object - additionalProperties: - type: string - DeploymentStatusList: - title: DeploymentStatus List - type: object - properties: - count: - type: integer - description: | - Status of the deployments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/DeploymentStatus' - DeploymentStatus: - title: DeploymentStatus - required: - - clusters - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterStatus' - DeploymentClusterStatus: - title: DeploymentClusterStatus - required: - - clusterName - - healthStatus - - podsRunning - type: object - properties: - clusterName: - type: string - example: Minikube - podsRunning: - type: integer - healthStatus: - type: array - items: - $ref: '#/components/schemas/PodStatus' - DeploymentEnvironments: - title: DeploymentEnvironments - required: - - clusterName - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusterName: - type: array - example: - - minikube - items: - type: string - PodStatus: - title: PodStatus - required: - - name - - ready - - status - type: object - properties: - name: - type: string - example: petStore-677bb7cc65-shb2f - ready: - type: string - example: 1/1 - status: - type: string - example: running - creationTimestamp: - type: string - example: 2020-05-12T06:12:00Z AsyncAPISpecificationValidationResponse: title: AsyncAPI Specification Validation Response required: @@ -11438,6 +10953,9 @@ components: asyncAPIVersion: type: string example: 2.0 + protocol: + type: string + example: WEBSUB endpoints: type: array description: @@ -11766,6 +11284,14 @@ components: Revision Number of an API schema: type: string + deploymentId: + name: deploymentId + in: path + description: | + Base64 URL encoded value of the name of an environment + required: true + schema: + type: string policyName: name: policyName in: path @@ -11953,7 +11479,6 @@ components: apim:api_publish: Publish API apim:subscription_view: View Subscription apim:subscription_block: Block Subscription - apim:external_services_discover: Discover External Services apim:threat_protection_policy_create: Create threat protection policies apim:threat_protection_policy_manage: Update and delete threat protection policies apim:document_create: Create API documents diff --git a/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java b/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java index 7eac280029..c2400b1269 100644 --- a/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java +++ b/modules/integration/tests-common/integration-test-utils/src/main/java/org/wso2/am/integration/test/impl/RestAPIPublisherImpl.java @@ -48,7 +48,6 @@ import org.wso2.am.integration.clients.publisher.api.v1.dto.APIBusinessInformationDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APICorsConfigurationDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIEndpointSecurityDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIKeyDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIListDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIOperationsDTO; @@ -79,7 +78,6 @@ import org.wso2.am.integration.clients.publisher.api.v1.dto.ScopeListDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.SearchResultListDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.SubscriptionListDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.SubscriptionPolicyDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.SubscriptionPolicyListDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.ThrottlingPolicyListDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.WorkflowResponseDTO; @@ -1017,7 +1015,7 @@ public String updateSwagger(String apiId, String definition) throws ApiException public OpenAPIDefinitionValidationResponseDTO validateOASDefinition(File oasDefinition) throws ApiException { ApiResponse response = - validationApi.validateOpenAPIDefinitionWithHttpInfo(null, null, oasDefinition); + validationApi.validateOpenAPIDefinitionWithHttpInfo(null, null, oasDefinition, null); Assert.assertEquals(HttpStatus.SC_OK, response.getStatusCode()); return response.getData(); } @@ -1032,7 +1030,8 @@ public APIDTO getAPIByID(String apiId) throws ApiException { } public APIDTO importOASDefinition(File file, String properties) throws ApiException { - ApiResponse apiDtoApiResponse = apIsApi.importOpenAPIDefinitionWithHttpInfo(file, null, properties); + ApiResponse apiDtoApiResponse = apIsApi.importOpenAPIDefinitionWithHttpInfo(file, null, properties, + null); Assert.assertEquals(HttpStatus.SC_CREATED, apiDtoApiResponse.getStatusCode()); return apiDtoApiResponse.getData(); } @@ -1112,11 +1111,10 @@ public APIDTO addAPI(APICreationRequestBean apiCreationRequestBean) throws ApiEx sandUrl.put("url", apiCreationRequestBean.getEndpointUrl().toString()); jsonObject.put("sandbox_endpoints", sandUrl); jsonObject.put("production_endpoints", sandUrl); - if (APIEndpointSecurityDTO.TypeEnum.BASIC.getValue() - .equalsIgnoreCase(apiCreationRequestBean.getEndpointType())) { + if ("basic".equalsIgnoreCase(apiCreationRequestBean.getEndpointType())) { JSONObject endpointSecurityGlobal = new JSONObject(); endpointSecurityGlobal.put("enabled", true); - endpointSecurityGlobal.put("type", APIEndpointSecurityDTO.TypeEnum.BASIC.getValue()); + endpointSecurityGlobal.put("type", "basic"); endpointSecurityGlobal.put("username", apiCreationRequestBean.getEpUsername()); endpointSecurityGlobal.put("password", apiCreationRequestBean.getEpPassword()); JSONObject endpointSecurity = new JSONObject(); @@ -1381,7 +1379,8 @@ public HttpResponse deployAPIRevision(String apiUUID, String revisionUUID, apiRevisionDeploymentDTOList.add(apiRevisionDeploymentDTO); } try { - ApiResponse httpInfo = apiRevisionsApi.deployAPIRevisionWithHttpInfo(apiUUID, revisionUUID, apiRevisionDeploymentDTOList); + ApiResponse> httpInfo = + apiRevisionsApi.deployAPIRevisionWithHttpInfo(apiUUID, revisionUUID, apiRevisionDeploymentDTOList); Assert.assertEquals(201, httpInfo.getStatusCode()); //apiRevisionDeploymentDTOResponseList = httpInfo.getData(); } catch (ApiException e) { @@ -1417,8 +1416,8 @@ public HttpResponse deployAPIRevision(String apiUUID, String revisionUUID, apiRevisionDeploymentDTO.setDisplayOnDevportal(apiRevisionDeployRequest.isDisplayOnDevportal()); apiRevisionDeploymentDTOList.add(apiRevisionDeploymentDTO); try { - ApiResponse httpInfo = apiRevisionsApi.deployAPIRevisionWithHttpInfo(apiUUID, revisionUUID, - apiRevisionDeploymentDTOList); + ApiResponse> httpInfo = + apiRevisionsApi.deployAPIRevisionWithHttpInfo(apiUUID, revisionUUID, apiRevisionDeploymentDTOList); Assert.assertEquals(201, httpInfo.getStatusCode()); } catch (ApiException e) { if (e.getResponseBody().contains("already exists")) { diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityOfAPITestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityOfAPITestCase.java index 5725ed9994..801ab08c75 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityOfAPITestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityOfAPITestCase.java @@ -29,7 +29,6 @@ import org.testng.annotations.Factory; import org.testng.annotations.Test; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIEndpointSecurityDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationKeyDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationKeyGenerateRequestDTO; @@ -112,7 +111,7 @@ public void testInvokeGETResourceWithSecuredEndPointPasswordOnlyNumbersAndLetter new URL(apiEndPointUrl)); apiCreationRequestBean.setTags(API_TAGS); apiCreationRequestBean.setDescription(API_DESCRIPTION); - apiCreationRequestBean.setEndpointType(APIEndpointSecurityDTO.TypeEnum.BASIC.getValue()); + apiCreationRequestBean.setEndpointType("basic"); apiCreationRequestBean.setEpUsername(endpointUsername); apiCreationRequestBean.setEpPassword(endpointPassword); apiCreationRequestBean.setTier(TIER_UNLIMITED); diff --git a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityPerTypeTestCase.java b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityPerTypeTestCase.java index d55cde7795..d4a2f0e554 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityPerTypeTestCase.java +++ b/modules/integration/tests-integration/tests-backend/src/test/java/org/wso2/am/integration/tests/api/lifecycle/ChangeEndPointSecurityPerTypeTestCase.java @@ -38,7 +38,6 @@ import org.testng.annotations.Factory; import org.testng.annotations.Test; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIDTO; -import org.wso2.am.integration.clients.publisher.api.v1.dto.APIEndpointSecurityDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationKeyDTO; import org.wso2.am.integration.clients.store.api.v1.dto.ApplicationKeyGenerateRequestDTO; @@ -129,7 +128,7 @@ public void initialize() throws Exception { apiCreationRequestBean.setTier(TIER_UNLIMITED); apiCreationRequestBean.setTiersCollection(TIER_UNLIMITED); apiCreationRequestBean.setProvider(user.getUserName()); - apiCreationRequestBean.setEndpointType(APIEndpointSecurityDTO.TypeEnum.BASIC.getValue()); + apiCreationRequestBean.setEndpointType("basic"); apiCreationRequestBean.setEpUsername(endpointUsername); apiCreationRequestBean.setEpPassword(endpointPassword); apiIdentifier.setTier(TIER_UNLIMITED); diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/configFiles/idpjwt/org.wso2.am.thirdparty.km-4.0.0-SNAPSHOT.jar b/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/configFiles/idpjwt/org.wso2.am.thirdparty.km-4.0.0-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..532e00d5f750750e823bb18470d94799f26354ea GIT binary patch literal 32090 zcmZ6xQ+Opzur(ZWVmlMtnb_X3?POvb6WiIb?PSNcZ95ZAZ0mc^cX58yT|eEcu2xr9 z*IG)lkWiRlaBy&7);#elVE?bc1cL&TmrxU7lu?jmmKRZwk(5wXW0IHrng9b!QImJr z5Jv6Rz4Nc*R#O^|c2a>WRU->&Qg~I#E)6HH9PUhKd;)cLhP~{1*kZsjs@3@7O;2Tc zIk=BtOsxay?1Ypn()V(gMdPft98Kcu7cfNDfXWb8?&oin2Tgq2pv|z5nBk!w>T?Lk z*zD^o^Qt@RcdBQG?g5|^FmYg9M($F#QgmEJ|JN)2l%5UCa}E44ci~+E8y@b z4qff~7Tw=MC5rbDRzzCO2lWy6Xve5QED2G`>9(k<<291F(*7}bSph812GvfS^D8mc zY+>c{fQeLY5$|CNnffIj9g;U#uLjh)L&N(#8fwui%y)iYtTm@LQDonKR~8h(X<~U( z8rqfQWK+WA0V4pxL=A%F^Z|p(7Kgn{90vBA3|(={3Af%Lg}`}@RZMQYzJ>M^TYB

sJ^WOe1BLugFZ?TJJqJn${XpY!+OajSrfsiBpx^yc~`vS5s z%oGBx{ame&`~u<;En0`EWIqy1?uvhd^DZL&NoR8wnb-C?kof@NV*>P4M5K6MJa1$8405%9PuuLd0 zFs1+H9i93Amv`|0aqxe62l?MYSh)XT<$t*U8~+c`^8ZIztpE1^7bq^FB%vTKp&%wB zp?cZv<+3T=!u;a@2Vp8Y^7O6~Ctn)S5*iUluwg4pxlX4Fx{HmBjG}-8=GWnYQC1pE zyp5R} z${hYMMA(&;>?s0vUW^dU94P&S|hfgxywtsn6E5uOM%+ET07kN^n(2ZQoszkjZk&pb=5^=kMtX3M+^Ly70(*Pum%>TxJ+>Z`~~l?egH((FRwQ0o_}q=UOt9~ ze(V1s*3;H;Ngr}qz!lXIybej?aE+3<4ZHCTGz2})$A89f(0!yEhc)1gA5;7YGZ%E4 zBs*n#Z8p`Dn%K}(w0N?;=|AI<;+3V5*jZX_H|g3;*J67{8)ioPdVvX66hIW(?&!ai zl#-$)>`ni=^juWPRrKlGPA;vpP5W&AnZ?4J4g0rzRbZiAfJ9Hn>lXbD`(RS%lVzmM z%sZ?%3+}HVHAbj8x?RoTr*gxXEyeJ@=6 zb`r&pnL1n>h64_qGFGqDjf0xJlb7K+7!sZ5`=5RdhmVoB8>0d>oa4SBqv2F}i%k&& zTvW6_fKInDY`t$0(>woEWTqUs(hdxkW!Xr)JG#iy5TG60gp!hl!D#8atkn6*&Z(1S zlNB%cBNpar$0UBUw!8Y1wNEwnG5P)=Zq!eV$s7;A@Mm66a3C9XMI+k|Q&wQ-XW9&D z2#`@I)00lpja*~IxX<16`o5-@;r~REESF}x&(CJK7-L2)6(%yRAA!K4eEGQ8m9NZ0 zmHQh`Gdaz8&pKjiU_nOsHN<6=?8p7?9hBykI6mk{s2%qGq|Z0I3IWzD9G06C z26NEPoFoy}P97AK%F>nSA9H&|xbRGhEXask%` z_|Fo&=Z*a5BssRjoHe2>TX)Y8e}Yd<3##3zxbr^Lz=bPi{azrh%&27*#+M1%y}P_+%bRpel}KohO`qku86wkgc`O1CyyO zjo^`fI@yd3CwMlQg3B50xf?O5wi=e)$V83{Vzn2$kk&W5e}I}eADxi1NLN{}zD+Rw z(sAymz5{|#zj^NYKVpqC;sLM6^@*)m<#p_(>ZB^6Go*)||6MBmO}qOLlymaG6CKjh zmvy?(x}9%Vb8PvCt6&LVZ0*l=OPAWmtthCP5#cSkNMdS*c&Mo| zW4ipq-^SIRNUB|XuSK!BKqDxhV$&&GW1)l5^MV9IijRtJlUfve+ zi+XQmY;hW?b+s|!3ghGG-fn5a9jDIlnlcI9Vw&gp0U-1K()>OK4Q}$#9|B$EZry@B#ER|Qb~rr#vfNek1OWO6DFD;f)uuD8r{~4pw+OrWUCJTH2p3J7 z$H&AX$UHc$^ns=d!_#GDB>;7|{blzyMjiy9*Z6=sxTrl1#{F(%EK5GBg1*9bSr|9^ zC->`FTV)UBY6M{!BXNO%_np9_D2Ighid7XL)c8l4KmrrmAQg-c8N#|XPRG{gq3RkD zpCtT)zQ>C^a8R2tr}>N-wj8d5+4C}jsc}z+CqbGtmK66@(GRYbsKZ6fSu!NE8x6Qm zcY5&-vi<0F9wg(opXVPr)b3$SPS70ksnV!7lcC`I-S(3Z1JhBe9qW`y@7B1=d1wWq z>Trw0aGwqrIQ0RTu zVeGZQNnhtV5!t1F!+nAFJkFWp*|!US0+FC3usob1+)}z^2G86IWDqg_Ud$U(Gi-o~ zss04x_iwbHzkz80tag}Tr5RIIP0K}Z0w0WiCGBM)JV{>GVrg94X~YRV9xkKifwB9p zebOHHM6pF+piMxMnBmts9>-!YRkR_o&|lz+9b3lU5wre~m!D3nV)l3XAZi-Fr~!3x z$%SyLNli$?v}!o|lRhNnuKvcSNxHGlw9u#OAlv6;J3mvjKdc_ixHEBZ$cNesB6`|K z9n+P*1hk3n%FX?aM~)YU&~H08Vm{;j{%RP1RzQnZYLau%kQ%_i%3PQTd{!d6Al_ub zg;~1>te^&?BgITzN_uy+t*yI7obv_4W!Z*YwGQG|gOwsuk5Oh_nU-~+iUg_KRsAw( zL|s*56$xv>-fS5IkZjMno!`8)n1@YKl{-MA=f&(UXw4czlUrS>IoD<#RsC)!zfGIV zQeCP0Kg;A#c+j>|YmQH}rTGzXY#HeJUvVmF^!vpOgv0VBN&T}t$Z+GR>U}|)8ykK$ zPcDlS3FWy!WM`#Fxe z8dCvcO$>DEI64dBW^V9;!hkWYw2@ot0G9zjz;U%X!fXZhJ$nPNga_*Z&-SOO=O~GV ziyuM;ySZ+w)f_r^U}EmA4ooe;xZ%EY=QX|y`x1X6vb1Ggqo$3@l_4mcN2)gA9y0~ zb@ZbcNAr1$C4p^Jwd4TFd(>6?@`wQQQ_xSt%X;t6Rd0FVCfwx4jOuQqYVy$pQ(xu@ zOP8ch^mKALJ+NGGjwXRFgS$aMyHdH0pkRrnfx~ZCt!g+zR-oIfQ;*LXM~lV6ug(0t z#0~d$u37`Fc|k6XV|pd)z~))>f#$BFx0)*`$K+n*M#SF(%ku1b6`^$X^^30U;kpjX z%;yc6D6=?7vq##fxeM}{8L4}t`21#ak<+N-*_yp;K{e0Yk?==nft`%_9~1WRa>^&t z0zX;jQ?6vmUTD04mf`mJn*_IGtbPnmk~dP@9=~p$_ZvxKK~s|kNa$@cNuEp}2?Z77 zGC0sk4k_^~qBEV8f)oxi`eVmL$?eNmQ1yC^tT&W+YDV3&FWz1Wg~0;rB9(i9yOWpK z`-u0MH4JSM>d`CrSlP^&KbcOlI5-34#&04T2x!2|wGyh1#q%nCRUqQ7(5ZNvaQHzm zLE49s+^El}D>T7?74{zf(fQ}&+3`ngsHUZkScVs^6{X)+#*wzgAr9`CKXj4*leZM1 z5yCmg9M7$?{9F07h!U)a)B=ap20@G=MJk`r7QhEY;>m>zWa-phInT#MXk|>mTkym}E zBMjwfjRi3&V6(4Z@zfCQR6W9O!_jFX?;a$L6}}TRX=I#D$R6nrU`yZV3p>ShEDb<$RY!)sShc8NhwR9vfONEy*4HBbDV>4nt^QjP5KTLceU+Hv$> zz(2hnN7`mZt;<;6Lr6Q=96!8B`2b|m9~}=;+k2hu(7F=fltUish}yu52E*UvK00SS zrz=*&Z1-p-(2|C&(Ph6oFC=GL-%BocS#Yrz8E{wa|D8jD+ETI%9M?*hy|U!uEDGt| z0cG$waJ)rBleYwvTuh%w9pu}BLhl*;FrmX=9T)NcV3QS&*~#4RV*ht8 z@a?ZPNa4j%sW;n2YEA@hOtjl^W2zKmMslz#QrRStK>u|}MN_N_2b`okIHi~_>6LZO zFmPhHDT^v#XPUao@s)c=-orL*G)w#5#%tX7D%ojWz}WVcL9`Ke<&pU7ni;~9lh*RH zk%BQqhU!3H#--WjZX540-MuK&krh|#`K@wo(xnBe0+}mBpHh9U;||cq%?&~xmYrT$ zxpS`OO zDBBHjN_QTpVdYcqHL(Wbr|>a+3+hDmptHvBbgew%8#6gjED45DQD7ZU1wB)Fv0{!v zr%pIz7cr1d>*aUzSl|SukgdTMbFGHWF|{Q(g#Jk8E0kxHu`PWFQ+FzTB)MRj5j(hA zt#kg$*fLVW67xS^^F@p%xI2TS4X7MhrshS+tfiNhT8(x+P7|5w77)7fI~cd~R#8t4$C09y8-|eVJ}DquJ9+SD2V|Kk(i-+rK(5vP z4F|#MBM#`Cc}x`v_CXVIk{mV+Xh$--s{N87RboM$GKE!YnM^?|fT?s|b_xPA{sxU! z9|GL)n|VnU3OOQK1x#Bj(y1;j za0|Em-ae~HO?OY24B{6Ig&wbDmE)u47 z5Y#^%kpldWYLi^clxj15LY^+F0}|q^tUCdwg=O3L=q4o4Esm~^Ma^Cgj%7eVQcJ+W zqL|AqhWd8O7NYs~s=3}hY)g=ni9|Ed$r$`;A|^Pktu!V+%m8wPRh=Ma7YYBKh|}^o zy&M{3VTQGw?4U)(xtGmQWsvv0IoUWuV!yDJ=Q(#-$6ExoPwfX^5HdxjqMM=I&UP3A*KhC90U` zsYQ}dF$-hdlRj8}7WeZsmUW;+SEhC~tQbW(8$4(H0>)!$1U`tLQdnmhCww)?`yQ(^ z-R0mGAuE5IKr}kNUTE)rtacDOKV46o`Jo5sm2^&>9&KM_e+>o4*lqi_w*bx1LMKU* zs4nnc2B;oXI?77qvpYr)4Pd;NXz^=q8MMc4gg@N`6ENtNx%g&*({es=d^F*9vxS;G!#keihi&wI#YXy_KjJNhEM+y9%A`i|b-L zjhD1kTa+E@V_U;8+f~H3JrWlrJM~Ka4cMv#VXs|*`%LW0-2HpsqtUKWEbh3Y8@>pN z${kOfr3cB*?s0Ur)i-$QK}CI2tH6(E(eCHNGreay9ZfGbr1W7mpEJ{6tgWcJt(gdd z(bRrHg%SxNU6z5YA;3ER23L@T>ByLrfLBaN(JX8k3m(Bx4*~_}!{)8KDE`2IIt8vn zG18?7p+}E)koJ34M|XnPqvE<=fv!Ou67B;n=xyQlZGkgX%e0iJ4}F4lz11*JPI0o9 z58+8>wZ)6-US`r2)<3r_##Qqrqt^p&oy80NMMgr+XE&Xda&zkZSRcEkrp~Wjil^lH zGwBAD#;EyOk(MYsk$jr}NF#wg7E|8-dr`TFLS$U0fFiwt{#NPCc7^&SfOWbmDY$%SPPXZ0~@9O;;c_` z3f=-AWN~TyzwW77XuYhyqzy#79+`afp8p+=&6NXv(X~?kr zw%8*^KwW$B87EL0fA=H^Eca;2c6m)8!9Z{^MKBDTE*&aCxJ=QUd zxNh10$Z;-!~<0-j_6bI6S zet;wHVSIbGBx#GphP6V8tiE_Zgz9LtlaLcZjiO(wJ5#0?9Ks z)LwLcz9Kb+g=S#VNu7{=$f?44cV%iAK$n;Az9AMWQ1FCTKsMSZ{D|f#R3H)k36iR9 z9Q&1Zmi(PEG1+lrfbYIuX{=flLD>xX(9=Ql^IwMkXyy%P*^lqamwPy`_{mb;ehOp+ zp?hUG7gDK(&O;UAf~X>6kTTMGG-IW~(kjsa)v+bbnR?8UBuxY#L*BP}{C|DJm@zHW zw@r+8sY8tI0Y!j-q>EW+kam8Jg_bRJFWI73%)&!Ss$phLoiv8tQ#hN2J46TManHa* z5RD*m7lSk+e}J4?qjq=XbcA6{bH*J8%bMjw(LE)3Vo+#LF4wAv=}E{A*eXfa&yT8aNf7j9_35(vSH&B>hBgD({aJIsjs zu}()~@Hdxkpov>k%;oQ!BX+Ik6-gI7N*71lzvhw85k61KuzLwBDeVX z4yo(P>Lgfo7!(uQV#f+!Zz@JYmGRn-dWSPXF?+wmN*IYhR@KdH0aEK!e7A%7G@|~g zatF>A$fgV^&bmg*P)kW6Zg~W z&-b}*an6oMkv>NYx%S98IpG#|)Wzv&2Brjo9fHEj3q)Z{`+hC;6odiEc&* zc+-HV0I=#Nd-PQch36619Z8Yguzw{ki+tC0Ce_P%`a5S~l(UwY00%Zl3;Gd?}s{y|W5StbY% zjm06Q%NwcsVc=kZH%B20EW?30)u*552P7OOPTLzrzS-89Z4FL#h@Iw-9UCa$T}3Zs zQzY&0$2HqJT~E-@czd7_yHP~=@DJ@%rZwc&ia=z|CpQo$6|d8GXoGOGozLAGEKV92 z{E%-SiBx4r5K(Bse8mXo73cXif2$;14JayJ2wy|yJSVF*YVhRs6VWMz3Z@XQ)dM1a z^B(A%^^0pP_5D_qa)|HfUV!6GUuC`w)W6iWOrJt@-%7W+LfTV*@H!y zxw5yzd!f&R88k-Um%+rF9tX#bYKukbbsL6mbf($l>3XU}75d7sL$l!*a9Jg$j#D!M zqYW-%&C&ZE;TMbb`X{bo-(kAKfUQY59(<$xLd_qQ7rj2q40XhcEJ-tCpakCcy5@M< z{#V$1W!j~#`U@pJ!3c0aUxTYGe63(89Mf&A)PXpeJta5AqMoo-jxLTHpv#1VgW#PM zPk9F8lq_CXao?IpnFDe(AT#;4L`&B);c+blOr;;oERra2<|aI_cy4v<`k*aZ0t#JX zAKD!0(X59vjg}EEh#tAeKAak~2wDt4@b=w9JAsJTLg!@6Shf(|YG&7K!H-#9bqW|L z$faJhON_}Wq*%c(B`=ssFP|clAOFc+{)syER7TAZK2kYFtP?@a$~ME9`6~z)B#-=* z)+p1r3lOmhDhu7lL-&22`_iF}l#2|2DqzE4zY38vU;9b6HNX%$m*ekimB&R zj=8@unM2MMQyFmf%dz}LKfg7E9qcs69mlpzrAj)l(qLwOiZyinXl!I2C^3#AqZCps4Ia&4X zXa`0?==5%$yI)?(_``earEIxthl3A;EAMKbdy(@)2S?yMV9*S4Tk;rpm=?dedmCB6h?`8=EXB2uo@|}_ zp}f85jRVCs<}=k_ioB7d%$&bbL8XNK#%U3AH!#~L@gB1>*z4x3icwTvZTcQFa^P4I z-Ls&&4zp>AOOj}(`UWf5QL7771VmiuUa!wR*~GqSrdJCM)~t9q6imeQAzLT8rbtE+;_A+j$L6y!;`5IJAVmadd@95o}uqmo+= zaJhSPudQB#pLl=t(@U)%Eb_CPL|lwfH*;RFi-s3luWL(K9iPa*3$&Tb zii1j2K{APIJRh&rdhelrYKZ4rDnd*>7gn*@#SWaXDpfg#86?9WhRYrOY$4M74$+r{ zzU_ZrR(wM=iE~1Rw`AtJ`tB*)KpswU)P@f~Dit?A@qg+N zgr+V{cY#L)eV`3t1l;23Ot(nDy~57z$y~(0;daZYPEP#3Gx!apwHP#4msq6l^}b{G zRethmeK-}Q6-)Ug`#c4q7n>&M<@l0Mmn<8@#!kCZ&VHTZ`2zt#=5(%GWLJ;LWR9=g zo`Nxh=YG-s{CD?trT0Iko|D$DP9vLhX8&BIs|v|u^&jk`)n3#o{6+k3zB*G!{#ego zCD3{^m{0`n3gWT}445U>1#HBpF7eO^%3a51z+|V>TGYADg{Uw`#@H;4dgQ}6g{w35 zB}7ZqBB}4**<@~f3L4zvp1m}hJSY#4v?iUeTPu!CY9DL_4*Ls<3)EiM$>4f1=h_rMQlgTsJz72&bz_94EZ}S1QgFWS~EEdQR`Chyap`%u?}Ijq`ZQ#=+$X`RAzs zR5qYMOrx&9WJdcu!>c`x5aI50d^H5Dx`dd{Om3P=oLk93+NvymbV2UE++M^=e0N-+ zEHYQqRB!G6;#*XbI~2E2+wDr$n+a$bU0!_qycYDs4G~DpG(rRx_iR8@55z_qbUw^- zYIa;UUq4_lGnQkK+kdrFzNn~%#^Kqp{?LwHOV-26#YNjmlRUfjXdN2&98NYiMqY** zFfGVJu9x7|}dp!~hgRl0_{^Qs7`G)d|G$J8wCp|6(7wV?Rnm#AZcX+1N8bxXa z${lniKpGKfh7G;@*%25YAiVi+`|*T*&Ohv03nD5A*J`JnhN>h2^sG-7?$e3y0SVMk zEURg-MlqdU(;%8i6^=r=g*1Se^8}%vTWU#opIQv2H4GOha6_OIk;pioGFyq)`CiP{?Ek6=Ehc~!Ctq>{11Bu%xx2`nE= z{G^y3FMAsM#$LmM8(@v3O@cR7K6h7bq`gC@d@DWNpiih+w?79}iL4+7iezc!5`A4*p~9?0C40+^@QX6tzKl}wKu3%5ZAeMKDrtx z5jQow&_#BPaX11R}5jceHx4M>#T+xPF18rcdnAu=>F{ZYl=5Zj?EuJ z!Bnl5yly|EWCLyt$dS!3edIqJ11}WC*TNC&W-hF|_Yy_cMHadZZZ`s}Ouh_|#*{G$ zULLoEH!c{u!aA_kh%;}a3)Es~Tg@E(ED3&f*N8#i{1a4R&?1rs#82HXqQDB7ETiuf zeMy+UHz5dsR;$A#DOf|~U*KqulKO-J&2Z`8S;yAmgEjYVy-wJ#k-Y5iL!M}r{B9$L zSm~<7HMk_$@O9ow6x3oo+kqaLL(yCGSO*xV$M61UatQU8>uf(7zp!uylwXvTORP5( zi^ZcqN@V#>j9Kh6`ka)gi>VPA5EmYoUrU0tReESGy z7;5J6;}*+vNY*baa7Nz!%EZm9JY2Z)p-fG4KAbs(KR2;d+iOr z9hdQ4NiF!>XBE#OR_NT?!BwYDMhyUK^j)UMWW8zvNtknC|?QL zgupuA63L*m-Vrd=vC8&+@X33&r*F)85Zh$CAB&r6zvM8wJN*sKFD>wq5%EJQ4_`ur zFy@2W+eozcygvupdWjs-Ybi(Cp7na#MVhDwm08D~xS+bcb`rutlwlZ)b6#a)-m6nr zY){q}wSa{}@KT7hi_I9sll3>D4{Nw%MQ91peTQMU*c;+Aj2__)prz7ApQoB6p7woL z(?O{SF8Rp2mNASwEygfDXE`3SOYhZ59hnSxv=31TEoD!kmTe?MfeNTx@xcck(84#xxgR-sk(1ST-Au!;EQ>3 z{xEl92p0+>oU?Hnn9}8mzfx{>RU`MVL;6)Gjn{P;N}_#2nNp?_$RR$=J-&vYd2+MF zyL!1j(cmlt2dvb@bNK-zzU`_cCqeWbc{P!e`LdZ@DI! zbyVa?jkZz7aFfxM_n0nTaIK*zo7_BN)gJr%dw-go7mZ+kjp3Bzh;)4M-xJtlzeil!!SuO84c`Fp6n>`=Fk+NEZExBFm%35({*0@ z@7>g(HhyYR2S&gw0kqFUl3BMdXN zmr_^qn<(HCDtYEs%7v=0^ZHqT^^G{REqWk{{#V(V1^Kx(<{XXw?tkMD2MvwZbpDeZ z=<*#mY^#k(Y%82p8LJJCag@9=LZ1%)s%l-jUxPQdhmB*wjv8%1=DF9~+`F0Yr}Tx{ z?<+9U4wo9bH%qZQOoxGPh zK~&YP|DL3~Xy8hF-K2fGd-bXTl(0VM)W+!Me&eL}``HmI&V>7MaZ?iXhIS~HW9s|D1vQ+-v8XVhEt*e-YJa;vejU^fk zU{!iQc_>V*%w(sym-vnoWCmyJVXoe9y7!NWkKR$Li9W#d&y>+=r~lZ5PcNSDrAIt| zk7uc-Xv^uYW@fO!B)i@!jOfp!CgK9~KT=fKQL~hR7?nLH_|dQ}U+2Yr#05C@r^kU- zNqcKGFT8j|z3k2M*A?130NM&rcWh{F53r@NC3nP3` zmz$Qv1z}p$cN{LcN99KU^<{`y>n=jY=mg7@bE5NN*goBp z80csL6Q6gxnH;Nm5Bi30bh&@+Fe!kwo!Re$!lOQK@un>2-esJ>)ejq?mN|!MbWk;8 z`1Lc4dSbG;q0dY~LW6BmovEUDCrhfruLgaj;V%Lv>zgQAu;;>yGNwDNYXndOroc>H zw-tC=x!N!*X!WP%7R@{fO4KA0R&O-7h=kM;U!m~FWS(OZ*>U&24b9Z=Znd9c@`uTw zHY2J9%AXhRWvY8&#`|cnGy~>H znk`!fBz?%=Nkam9X_Ml=h`@cg-Gmz>~jY>A$n)IAs4TRW?;5IB%&qKqqH@c;Wt z>lWWE`a6d^avo#T;95B6JJ5z9$Aa?@-dnU$Zrc!oWET8vS2EmaI8DI+2(~nE-}Jbj zjULVqr7BB|)a9egHPI45^DMptPC##{j-sZulgby|kuT2uZRu(Dz5#Bbv(9ji$`BlOsSs5xG5zg*FLc z)>R@b0-z?CZM@eS0+$$dqq#!gzdt^a=*@GeIh`JUxsRxg^;#GVs9cCZ;;kTcGm_wp$+6P;=o32wWvH_l8 z?rB{B<9Pc+JYz`*=D<-}C;C14RyE~yW=&wG{7zqt7K$`R&;%|gTp_7Ao*WqfA28@8 z^8O4#O?J(ykSpfT@$=UcaSn@EaXdADc;Y3O*lgT_h5X6fRaqOyRcS!13UjUP1?SK_ z2GGyPQ+P;LR&q#0Lq^tW1c+yHQ~64o8g5<~chdnM)dgdiZHu6XHgqQAxcJYNmnyw8 zO@}O_TUL1E!r-?KJFhto#`6JSRkzVn-=m){y<4EO^IC7)UkSNi46`IIFHQ_jdg_;i zanVpEHyG5aqZwie=BX}K#|1F;&|#qbFEe)9IQOmr1}+k!kb)c?>2^tb)ag@&)r7OhC+Wsy?aT4BH334tPXGJ*_VqI# zlu^+?DZ0bY37R!*D36~A8;qKY33pb49C=uruo$miaa1Dw^?%CIHHDYY6{mjdW(}ZE zvu04{(P1N?DJA~80@>*M8^d5TH+P@?uynI? z2Oa_q`J~tGz}@q;Y*P+01EjDt(VmWB{!X`Wf1_FhrypY%8^XA8R`R}B6mL8YZRx5k z4Ekq(vYnBEBPy_xXwmV!*jszsxe@)CO)qpsYW4o|c7iTQ;H(l)`cF3LrTahU5knRpLVce9>S5N> zu>x_5UGYeX#|3=SyiYjFHdQ~2LY7?PvHvrt1x~{(AE60Q_Ct5fFpQz1;r?TDcb;O< zvM7*{mURPCb2B{W{han$&=3PAGkLTmnMKQGO8n1bSh0W7uE+=CHK<=kNXr9gp*=ET5+ zL+zSHmp6*cw|jtRvd19LxA&t{Orh@kK(x88rV=GNe*63Et0c7JCLFRus_)l!6DNe> zch>Cg@+J6X?&(`OQ-|vl^9c=RmW%=ViHJh>7Nx24kch&+ygo~Gz5DvD`Tm}*vAn)CFB!{NKa(1U|2vM9v@q`(*(KO#)Da`vRSEY`8^U={@ zS-iljmM{4`vHoh9`S@P{Q(Y@NQr3|*Mak3D$N3JMJmuB%QAep}C77AFs2iy|XW=JA zsHTRfy0d`kP?=|TMPbs+@2BY4hkKLUAC12q!-wR@-W7HS=s6Ar_T6sam^m1ly8a?q z{5BIn4{KqtO9&Yp-==#79~;RE=~o(qxNj(6kQR{rixCAW>`OH3D?xwp`)2vROT+MV}~t%#&?rm!b!o17lGE&ZOw_?PhcWph%(Yqt#|~&8(3F z$!`>fhkVI$7nX)?*dp74FU!1`SgK0%bSF|hkU|LP)fCb$Gb>v2V5l>GOyeHY$8a44F4uTCEczGo&LR1t8Q<*0e(i9L>K$qCih$?m0oLyZ_ z+!!+&5fNn^rmfR(50HaQ@7M}8o9#IlVy|F;<%{k43xWEGPUu>**ddVME_;`K8P--L z1dfLi740(CA1)I$I{U}`mE`lz#IH*C6Z}!vN3*~Yu56dF_z;G$8?_fo6acJHcC|D2 zz&L!AN0p+amc%gzb?sq`&ufu-_|~Ri`DvP_c+xN7<1Nq12Tk>%yd;&9O z`wU&y`rRlTp*pY1s|go~)s2-8>Ub6_DsP3}&8_*%ay$gT z`z`mmj2wwKBo<(Nl9{#ic4%c!%)1f|&3*237Ja_GvjY{Mxv9JFy?^W90+*sf!X5LA;pLYuMn|}X$^dw9`G1o_SQ2`*-ciO+H^GtzUkwGGVp)NdMx{v^3HiE@hY)hFVF*33n_%kBREA0`(ycZ4U6V$F67`hr zerPharRHm_>e!Kon;!e($3(+ia{g@^Io6r6gN=J7Kic(rl^qVI{0Buf1doR0XK;lV z05ON|*cD(yS79rfastIjgFy2{-z>?!yQ_OUKM2Htz=p^+pkFckPI*-Xmp;iWqeed`oi@sE|0?Vuwm`+T{~Ng%7wTdv9>b*)1wWiUO=o?{7dI4XU8ea@v80T#+3*>L92j>j}pJv1)*O38U`KQZkG$ke^QiU z9!6jL`@z0Csf40IR{29a!edjp+>~@>1HK`zW&yaFoT##mp&}V-Tqvy5*)n5+Zh9;7 zF>7NpWkH}bT-o2#tQfU;`SKqD2Wuc=hmg|Kp27z>^1=l4hAQv;)|H;f{|u7)e@2Jk zMpz43EzM_=0}h~IV3{`fS646k;?X5T%gq}&U~bm_nT*kBf~oK%RMzgFn(ILk)%Y2oF8jYG6E5U~ET~W1tUN!4|?swrL9;HS36K`coL z-Dn9fO}Km1Fj{bsV)DK&Ib3Qh4(f9n3BGB*ha}vEq7B@Nosajh9K=E}Bq0zHiT3|` z;?yL`9u7x|SRBVCdKh!qKSC$Jq1%ZfBuk^D)FdZ5CMW1NmuuwTnrWGHi$Kg!f{-ID zaqVzBoS32|)tDj@T!lHLHzasAsELDD9=qCH&lbfi;KvH=KGsb6n4h6Gdks9+RCpx` zn1Ifwtm?CCiiq;_yXI?aa0VmVO&<4-(T9andOalWamQs_ua-4CA+wL)+tOC@P(cv) znZE1ZaHtp<_~!Z8R`#5s@`bv7&(0atqKJ%;CE}zD8m?r^oF%v2aqhjY$d_-EY~qIj ziR?raAm?$+gy(^W>1UrhbnSr`TakfcIvZ%T2v~UFnJr<3s?$&^ zqJSz#Dt7vJwdVxe4O7!9eCx}MdaYN)Q|joi!q4DMpLH=rb;KyYa`pKp(!VfFfV}B( z{n+0U0oj_PZqGjJjP3?4UQm$6A73h6rL*_}@qTLyHZ9=2u6g? z>nmrmMRtNW=OYNY=nM%4wDFBdOZrX6-z5vBPnRKc=v`P9j@1_ZW|DSPzqbVgzhKUI zja?EP9fW|QlIeh+2Vy`V@wGYfNZ^iuZ+qhvhTgHce3LTxF|<-0aeXmu(a!bxAJjxQ z+jGLBugp1#d_r_|5OI$JwZ(S$-BoQ57tDWlX$*yIUtE%_*FCZEO9}H4`KqvclFPEq7FW$Nv6ORAJ{4-9F3~inG zjV7plY?CMmYh~f#J|*7+Ax1#{2hWUxABD|maq`f6`){GoTv zb77at_0NA=zou%oJZM=36`(dl9bqtOEPUj8TO%dV$VsncF z?KPn7yL+@hCgNYbkR#68k;(aZb&7(`dNDqn_+IB<8)=T=>usGLP#0IG92yL%*!j|a zmb0P*;$8G&!w874;FYb^bf72Z%rhOWK*3MYm&n7GK^7=1C!Hvt!~70E*b61@t${hf zObviA^=>1@48OzIvVTyH2D*1+J)wBDf>>s(V@<|)lM3b$gb(%z&l^F3?Pvoo5Rere zv~c~o`K)~0f77IE?Af(*e1|IW#0V6EQNi`Ck`Sle2z9+_x*um~rY5d-aJx34b2S1E zw$_dQVxD7p7*CA5KfAlfIp^RJ_4iaE$IibTiw>LB5i=s2x%i@ZLQ||Zd`HZI3Y9V8 z_WER2qjl8+25)MkHdz4QM@gji@5Q0hD6XX`lztUit>m9tN!nX?UZQ}P{Rc$f1RlC06K$yJJ;K*Mu zA3Bg;-MFjxW3=6l^=@X@ZWsLMYQ>3nm>#o7s~ z-}_L)E{?;VySo!4BFOW<${AZZg%9*mWEEfW|G-i0MDuGc?_S&2fFrKa>=Q)dyI|tD zBtvJi2878gwMElRsTYMsK~}nh)#H+S^g}F}%vSi@wq;YkqEyI^5w1zT{Sp4O!~Y?uPdBrA=LLA+J@!^gJj1y2xtF>zx?rjJnP+Oz0lH4vJxv zj!Foua@QiYeBayxrIEWFm^FsPgz=|GM2|=-RBHw^A;_d@cXm+@ip{s%)TZC!GRydC znZ490?T2AD>riN_DWXme@c4`;5e5gTUbmMGqc5DFb%*PY+D<@d%K^{3pURvLp3D`!y_2$*2@bfhS!F-&@`u=TvQI-=d zyq*GA{j(!&)G2r>dG1!>k}xJeG>n4$STz>R1Bsk{V#Sg_3=Rg+rZw`8bP88eu=*x%G3cY(;44Eu17Ze)1AdK zWD7N`QS=EUKfqaSrVyx5aztgcs8EhfBj9zrX;33c;RKR16OT(`HCRyLP7#T)Xy7sw z2|ako5thoM5N4RDIka3k_q8}bKsC+CnrR5pj}^-etw2R`J14V)5TkuYrR_BkW(lUI z%#eUc(E-hgB0_}`vNa>?knMWRF8@5T-e_EqaA(O%tDM`5IO7Nnfsc+;rVi^y*`Lw~ z8*f5;`iACKTTk$)MxUo}NJpffzoAMq*>XxksC0=Uy0D>xKSQ*V({}ppCl|=4Hi5dF zgmAZw8;1_$P;57Dp5Q~vl#J{KZHpZ?wapmAlb#R7`;YTL5Pa=V z6Z7;>k3f2Ch2stDm>J7^T^b#;!-;HWt}_rKRKA>C_;sCNF8Zi|>^eBTM7nW^rqXuM zKK=YaOOh*AdmS|yw?mLPvYJfcbReQ~;>|I5d@#W4URJ&(5+7_x{*3&&!IU7jrCaUs zd}nU;IefV##xVBBCSCPVP~E-~u*3~~%sm@!A_}OrYHUu!Wr8m4Roag4pn-K;z@2bt zdg+u+^xdVxg^E1h;NfHIQF~JHqAsJGWbVwf&Q89sn7!Q|Il@Jvg|mhGD(|u=LhmJn zmHbUyclY2=9@~9H-r#B@F)UTVK&oPQGC|l)> z$>dXxgHuK8UY^-qDMEUH$3HTkCO>~ukAl8t8v1~7pH+ePzag1pAk#_aklfNKb7?eA_iEC|r zy4J@9V^La<&vDNX9$n+dI$LofL>actSxBtwF++cZ-V0|(8Y z%(NkLfnni62qo?lC-os$s^#LLvnxF(@}IXyY&CohU1hNyHw6U`^X#iNI5 zQV>_Uxx8Vr zHigu!JRv%CLYa_b)@H*Ufya0 zHy3<1#P^nUDHXk%sFom?-4`^Li2lY$`Gw*$`I9{1lbxr-*+Md6nhs}V5r}Az2bXiD ze!mNlLZ{c1*d?i2=_;G_cc)0Fb|8)IQ6yE?5fj7%O|gp5ga`%V&7BU^sq%=}Iv{!x zP51^esOJ}25K^{kYYNRa#S?$fFtwLvGEmRq8(A5=!ah}~4;Yc^$a^L^+&?%|Qu`eT zp7`Vnp7kzR)yoIImIiB?8d?jsKYy)alPKSZ&hged*uf=ffBt0)-{R?lgXY03xE$iX z^DWG}-`?-hvZb9u{*H%t`5r0D!iR*+IwS_Ay(tIkWl<^iJb1rRN|61u*o_W7(FnX- zY}e7sz|hK}-Oe!m;rqr`eG1Vr=&x0*vyta73K@B%!Ui0xm-vTHBKO}wW5_*xi<_1{ ze|Go0Ed5~w`@(iRPU$@u^L_HGpIg>?x~obQYN1c@WaQ5z!Y1=H_ts|{Lvje-~P1#S(iXkKgaJz-I$QQ=A*)O?&Xgp59f*oX`}PA2$MM7~;;FD7n>L=TVqYsE{7{0-^0 zrvxfz9)&eHHY~(?7IzwF1q-Dta&eBVmIE_}%ijFHZX@tC(#%~yXQy+y1ux3Whqt?t zYhhTSI)HJz05t-B5p^$(H~UVCreZ5~XybBNs=-oZbn1zD!&vkFpiaZbgQsFf;Kq90 zrn3oZYg$Pl%6{emFYh2tMl0i8d_jdSamr6RuUZeAdiZ?HS0etYBMw$14K~>*0@GE} zvrIF`Ctgk92$i;$o?D;`4(%rG0zV*MrVMHs<69th9(10{CmIb5PhMP`Pq!nd6yUT@ zAGA4mNOiR~cJG{F8wAGn!DS*d?|ca_WU7$}?xYE}HOT~6iFyXxg@bjT>1oH=a4Ut# zsOvoD)#;N1#eT>h1QQU9wD|%$2V~zzaZ{0hZI|uSacikTce7uzSGGZ4gb@gJ(kI^> zTMNT6p)I#zs=(b(m3L8=c%g#ni$FdUk27brv8N0GEveMTO^ErjE1+Uz!yBb1ggq{Q zQ7Gpo<2Sg8eApp1A8sVuiQ=9Hn-BUqJApbkOR1*R>vH@dR-piJE#M-$U&xqeC?1;f z6GQp@{Msk@4^xg7^lh~qjy|rUlnTuCuu?z+jm$?T=8tiG7Z=;-vYmuD0d^i2XEUG3 zDTFGpn1h5~{4W9L9Torymd+eUR&f=xNzWSH4=89(Wo<}5iLhGW?JsalV#3Phv(gH? zCr|mwV$9Lx; z*~v;s1x}0GIw%U*bw*-4=4E6GWCD?U%<+ZA>i{_}cv(8BdI)2b$>nl{6q44Af_@UP z-)5=m#=aK z16(ORE~?+6j6_iK>P(37?8209>3OIzo$e(uL(v?rjy&@r5#^bkqJn|493?T>mRNJ0 zysM>}ZA}M8mw>R=NtqxQ@yhnY@l+rG6-u(60DaLqf_{#u^~~H$P7=8VlOjo;Eg1*O zy#`ZEaqLXd71}6z!-M><+r(8+=;y>{u$Z0T45lKDzQ+*g%dE;?r`DBa8~#iCC4C0K zSl6M>Xm4}%Uj)_o9<#GI8k|j84T<;5y6Bt!H5wL#M6xkR=gBs`8w%!Bb@vo-a>@9D z2R`KurMG+|)A^g||G;_gUNsz1s$sI9S;-WJPeWR1$Cw_p`-ejVl=6Rs2 z`f%{w*?p%l2pN{2O#L8(4gGBCv<}#L%G&lca{mz14sk6QlCb}sYS0S54=k+r)NB0k zNv}*$f^W%GEuSy5r~#o-({FR>_%!XClCu$h8AdI|D8q=@_U(!J`sa@QFv;AarIl|g zHAb!CmXVat6Un?oI~5u>VTow^{u$y=jrY9B0n6i7i}KtZP9~pqXkEnGF%CErr-{K+KQw?!i4!}l zxWzVm!rV7z``$){_2Q}BV1Zxdq0}jzl3s?3c^$z&RBi+BE z(!;ERDZ*=Q6BupTlw003z<+2VVSTGu(^S%Jo56o{P`U_f_4AsIJO}s4RB}vrix-@k z_a)h{1;zXvL$7W#!eCuh0h}0HAC-dXh_|(cf<$MR&s@<&8we)KjFd{_!&o~v0Kw9R zcW`Rp>DmW>EXR^fY`x;?DtAlM(hD#4)dt^=r81XEq)y=bUk-M%4W%Hk=B$X#Fwx)~ zT$;VPtM}jfVgs?0S%Z+zfu>*XX~w^)oZ3|9(7P`fg3~ijy6~*T8_C~3xO9Y>_D&DM zxr|fauU)p~aq@lER=VI+kXZAwijPBf@QE{}AY+Y8t93mgy|k@MJHmx*hMtHRdv@(r z!k`RqAOrWR8_Q}AUJjP0QzK0O=wd{InJH{@*tGD2Fc^MZX$APWCPA@>VqR9UDcLuA z5{>n{`c5e1y0(uqDQT%BP;0YG9dWv@duWA2<5IJ)daL1AJlldFoXEQe4v|;@N{xe0 zow%t>OXp~k4pae5w#_8&JP}#aKVLKnS^cXuw6^Xiqacok6BC)#^r|D!>mM=v`PU-AR?#G`^0;u<$ zg)N>SF>AW?_9r;`=qgw(C_ZS1$qY-IDNXW6FM8)fa2A`GHP1{SSaj+n__`H8viljs zUe)PgqnmWgQ@aHbuI+cghmAu?j^c_rhMS@lgag|E+G6PaL;}qSrSt* zKUR_-Gkjn>)TI@O4Nl}EC}Z4DurRN&y}!*;uv5XP4KI~T4P#m=Ee_8AdypQPTI zsbS_67EtQGW0$NoKu5UKD*TK6a963*rK(__j70*`jfJf(`;r3jX7ugsF+m1$GRGht zX)I-di~9WslQO6FOx#(fk_f8-$EmOuHKAh6 z&#UB|wF}47gm5`GduwaoSqv8LzrpzC8jeH4Tg|95k5)Js3+t@j!{;W)dd&OQI%X-Y zs(D6vm7;7>ABBFz1b#-6E-cN9)tgDopDn6=fCX(zi62HO=kaA}UC_l#kPEWTxmH@j)eHU|L^ zXsO#&*qE67pk_hTzoaW4!YfM7XQ_e0OAT5$E2%>fOsqtoL%e>iHJ()IomE2848?Q! zt6l?(u}oY1YBdR4qVE)uZS$dD@-x+lXZvY+;d?tYqSI<3F-k>z@6odMp)hJeJVsB2 z%rWjMdwSL|v=D5=_ z)UQqr$q&sK!wMUp#jIlpT|pyeP;F<&HD7F>c*Twl;gM2=^X4wTWxI6}Jb$Zly_)o( z-8IQW8R7L7!6dCKEi( zD!FUo)3~FdFQg5P0U*|@*Lj1Wddf*((~;5)Y}``QR3EgOr@1bXrjp2w@x~nYQ>+to z!?>RQOC2;6r>TxClg)e=zjH+h@wv22(Z0Gt+PAU*;l1mLG0RKIZC6Yu6sGgyxk(=~ zQI=#yE770cN04(pM6m7UtssKchn^ZMQBsd?zw9hG?#Ui|x2XZ8|?NQS`^ z6g8Swhg+Yc@r8OC7^t)0t3qEMUjA_dr)W{LIJX=C0Ivbi>*s%68Ef#z4V>`rZ{QRc z;r}8j_hm^{&32&&#p9-I)+SHR7%VT1(HLtdxMDM)gx^@8-hw11@MAfCEm(OU4SvYe z)#rp}?;JhHdqs&nCXvIrs-5$+lhp1HXZ5XLXa~~}PwWfWe`s)CY;woi&)cmZ+#T>e zN;qU!gP&a;%&c(M8?it?r6`qMKRkUMXSUU?EyG+MXm)u$;#zj%p&Ht~FWS_sqE3C1 zz*6+n$1S(KYG&Rhx7 z@~y-af`@pE75e#FfbOQl7Se7d6EV4roQ7j{iyGFHX?3NLDJ4A1T^h0c<{Ss0q#;rF z*YG!455uNj@}8PfZ7BoNutCfkej=hesJZkl5XkYE>l2lVTm~cR27(hG#YKG-fmHRv zSXH6zX#>{aEy1>g0mCUah9W3|!o!qpXq#BA)m3V*9Ir0fYa)Khm_5+$wQ=gKcQT~f z8;h)Afv4*)99wG_VxZL*6tZ6D(>#~0QmO&CQ8`7V$mDo-Bmg54g_P{wX+nMurqcRC z$x*Mc%egoczBNp#81y7LcGmt-T}C`tuYZl14Vm-RXw+|U!=XV)qV+K8$H^jfTsXiv8sc&lp zzKoKE+t3i@O>`mbcsah(O6#H*o zno6L)_^DOrjaxB_sGwjMH&$Z2J{9-NV(>MxE3$Sx&1SeN?|ofz5U}O~9Rw~C@oGSG zOZz>RT{%==a@6I@V7M)sJ%eUi6*e5gKH}8rnvrpvn5y1ZEcU}z!$JbdjIp`N26$yz zV!l+M%9c9|f2I4Jkzj2nE}WvF%ZDL5jA#2H8oV7MK%j2bLNX?zEmF8?>@oA0Mw8?K%)_2Cn`>=WscE22MvR+ImcAi&FUo5wV=^ zbwWRs(!f4=`MNKn5j+b=1i<1(6U^gYGjR>Cv>Oo)ds()8u@zjHM-Xlg#bU^!e|`DN zo=t)`AgietCP0$$lrM>r4zjPY+jj_1RAy#3AcW;1XJ%(@<*is>VS)p(*-rjm$Y3KcTHEHlABM2o60a1f6Deg$~RXdlN+J23lDk|{hFUE z1Bc9f2H9=3l_VUcH_KcN<>4uMM<^EZdSbh6TEfem#R7nX(+OmmckD}Yj0+cv5mCn( zk}5)z_}1~9Ni-6Qfc`x0hI@8fB2(hJ@%g#_l*X_1Bm)i9nFol$a$%+@uW0~uv|ayj zGqQ+l)ERpLuAX5vO)b<-L8X3aqaW?LdIS%R>vOWm6_hK$&tmL=g!^Dt zjwc+Mx;td_kG!?#bm(gvk^R2t6%=_imZt+gV20dIwO1|xEx_r zy1ebm%UVF@f)7fR?&qE}$nlS?C%rJmpp<+W*WrFVkt<%qUrlh_H-f(`*KRR#>(E7S z#o&y@+IFBijN&nXFNuOIy#SwlZKI!pOVk>*f%Yc!_KCpC5*xcvVK@O)2iNAf%Lv*6 z_0NxFwh!lo3-K}m@VN5?lnKL`r9%Mcl({aB(jrNPmT2RGY8+^>EMH>8VNELzo83~N z#42cCel&AnEhmKRFTt{|@;$VdRF#-hQR7J;9V5dr(fodkc8oZ$H9@Y40Ql?`Eubhh z7=h*oY#n$|M4dlEY+0DPq7zvP@za7Pp6Q-6?ljAvF{$)y zJMa-Gk7I~(pmgHhdC}-(az=vgd47UKTZy#J-U`1NF&Z6J&e8uv8FAEf~>yCO>KApFBYx^L8!7_g)b32 zr(w&>y0ab=xBQ^Tyk69EJzph}F+R*L_uR>h=!W;X=5<6TUHsf&=IU36K2Caj?|?$U>lN`BoFvIH48yPmR%arTVpo$!Qy+a4FIz1iN2jW$ zhMvxkuAsl2SmV3u&fk5GvN3$voQvaaOA=?Rpt_?(LQ$214Vw1;Ol&G#Sg=t9PK6DI#BQ zXn)HEejyUI<@_0k2U49hwf$SY1j?y=OGS43TedT(FYty?I6t`2E&gMo8D@Bted{LgiK|9(s}#0i-cY5;szHL zW_^Vno@$4V=Rv=6K&G1gTZoaMYFdDWHVv~ppn9B6D0 z1JJbss`>>cD0Y()!Dr7{pJzWwEvcn4$?Q`E)r^;ahin^LrL+ZwI@{?}=!s4hoMzXq zH$->CJW8vl*P)wJk1iN7lFO+sC{W?#91Gc;s819nhN~UUa~AQAStt}ii73W0>=($T ziy+ZWnk~S#2SN&T6B~+Xga*N?$m& zb}O@6biHl#;s!(p16qeiWx!R(;2ZWPcXS}~3%Efu5!dWs3NW*_K*fNOY>strOKN$6 zV827(4&)yN3+KWhOy5}-EQsVxW%RZYjdMo>9fnz#MOQaJh%Ev^Ake#*T-_V)~1&vzTKsB5Buir z8E{mMo}+bG?CZ6sb;(7Ky2fS|P1~Pa3mssVs5~#Y%u{v;JS+^0D3YC^oQ4vXOyjof zRxo4!k$zs30;3@G$I57L2qsa~r7E%^m45 zwtD(U3^$&9f`NuFv6>0^ga*v5aS=|aJK}*`yjOP}9^E`XxkwIx!|MACVoG2=1OwD7 z*4S{Qt!?a|it@OywOv7-Ojj)!3X|d2xW##a1Q<3r5$yPb`Sm1W?S^ld3_5Nrck7n) zsBLTrCKR&?hGE=cEjb$+)Fn$n(|m76f>T|q!0H5SWXhXAAW6sZ@X0c}*I18*XKN1% znUQ75em$9x;&O;spGoMnEdk#I+O|4$)Q&|7?(J(G1oGqrzoXx!-B66nsQzvG`3j~F zz|!y3#use_<8D)n08{c3W9Vck6$j)YE znn7vXg2@*rAZa1Yfl_(5pzpmIxKFUij)h03Q{Ncjb*q?p9krRm)AQwzQ4|^6L7YWzXr7c9rNcqR%lPr49>OR@+H9U?H;AwxVVdl)hkkGq#iMiHVag zWf2QV#bi-IKZ>KflBhFq>2}z*#F+0JrHD?AmYzas^-Lv=)mKv!$l%Y6g^;HSnNFA| zrDFq=@GC_OQNYQBPSl@mul5VFj{;IhnPK)na)tJUF$=1*dX*_DDJzXMg9)|LT3D_{ zZ*i|=d@xo82y!_squne!UVA+V!nORdedP&_hV0Q4dBT`4V+yRYhYyR(uRt)G{Z6$g z&jttzgqXwk8O)L#MPU0dLDLZ7)`)(sXo&y>DYNk8zEaYKhNe{fCh)d}CqA3^_Jju1 z{$MhXJp&CMlIJWNw}qo`z`=nfw0<4dYbWxIFgDpm5x@!vl^K>c|JInB6oyQ4#AcBv zmOyu_Ce+9PFT}b|bt(UH0BR`;OahxG)!T-#P7wOLc1hy0+kJwjv;+hv&dEmeR!6fb z_DBvvVD%QPWicE2xc)jV`0azjBcF@!ccI$i*6|H4;lg6Wb%^;sdjCMbeGzU2J|n3riA&Ch_enK^>4L^CS%`qQ;(^Sd zvg@_HzB3kCKRCYpdV%%=_?9fAx_Ujp91Z|LgX(>jjX$aS>kob>%aD|keR2a*mR@SC z5;{{`LxpT>MciVafLZnfaq<->hSnLN=vLa=w&=tqIMCpxz1*r)I`%cFMDF}@7`z2n zGVZSs6sh}Ac*h9c?6{7XZEiG+1mO0M3Sh%gn)|&LFXi?1JJ#@LnvlO#z+Brw--7n< zl7;*U$9iA?f5I(o3~3x~E$L~r&Hp1+On%1D}5U~V|`nNUlp)EZ++Y>WgYzbbgbRq&s#)g5=0|o6c{tpJVJ5nXlm^0 z<=cxDiIf?l%B~{>XJ)WLBBYS&BG$v<5ubH`%*FcX5XOFAhGd4FO1`X^(L8MRq$p=F z3!0lkhJdqK*;RA%B0HURUq!`~<6U=>tnf4G703&zCZY!B`6t#UW`+c5QaG{p&c ztyJ>s>vu1oCn^3V2@&W2OSPTM&6?#UBIiHBH(yXnPa>I^IV|vhkx(p|FQhyIM_icF z2-o##JPR}f_bGh7VQ2ORfXw*Jm_SBrX|Rkng1!{Xc|u#jEFNNQ2O1!g4n-(OQfYm8 zuqX6L-XP*4YZLpIc%f@9#z$SKaOy)cCZ#A%lqWp{j_Mx`k@z^wKZ$7MlDSzv5Yz=udGu2bFBXtg@#V0U zR89(?jH+aVx6vd@s()z&D|?(J6)ngjv}fqdH%6cDIKY`*HuSj?SM2R^GEh@pCbyu4 z|5SP&q3dO?^W4gJ(;%+}d}a=_TCC;FApW{9i`y2TIOAb8x@_p%FXQ0>SfRku4nqIE zVE$+aj)m27{3#D&MKp^|%r?3dVLC&V%%^F*mz&i6tWnU4Bl4Q+GTu$QAwzn@O+ee^ zriZHf&Nj&lO^}6rLnO_pQ}L{m+;8(eNUgr4K~od;;aa2W02-=*OXn=YY{_PyoL=Jl zOiV}oVYy6A^fcsuaAArmG+TRg+~-D&*8XfujRt-OXurlgVt|x_`{+Xowy@LzzMx8! z*8;&Tc5?d3yr27RU@9pJ64SnB8>#|-KQRCFA8%QTq~wG|{*fK)?;Ovce`KQfz<>FJ zH+MjzYiVv}X`ydnNAo&x-6Ja`yFNh&+;Dw~O+!vZpI`Q}8-xsAa{`FD_xWNjBw1=@ zDWw)165RiMrM5!q7-;!@F-%c7_XcilnIkrzNM!$M;m+x16OMo4%T}?EY#M;>$pQFW zV!Op!Os9s6&@WcR$*Zo?-N2su2v(^+F*y5*I#yotW+kz;qFr48*w(s+vtd&g^@-qg z1rS{YwfGOYMdr{e7OOtYa$WYCvdn450z$H5H1KDUL_W<$Abnj0r9|Zsto}&L8a()! zPn0H(ax=#(utRWfZ3^Vtclnw&41f#p@7nY=Efm13xBQQs?^{2-Vcs0~e*}bn5Bv{3 zKH4AHe|4js^M6zX%zv-u|7UhE{v+`IHU<56E4)_bU4dRT$-m7y(r>elm;}G2g{_^o zg`F*pu9>#2ZJczoWalSzPL@45g52CT04V@y!k+Po>b1YS1+o$k0|1rInDdjL)$YS&>Pcxm1|}az(Crmq^WGMp|QCS?#-|pBajr z#&dTIx>+A(maIZ94BnFToB&{Nh7u6YH}weeHgdt(QZaE}M{WLJM(+Q* z{moz7-$Gy4&eGI%Z-e| z<{@(-4H>4GG4&Sl5YT-j*{N|b*#&*ElnsJfWlkW(a#eYzh)l>o+q?N?qgCYQ$rjwu zN@`}6n5&$OIqUn^cu|h(BcO+OFVT^`_hRs*@LTQh8TeOK*=`YWs={4HD>#{;t@qcj z!7O;NQD?1M>h67xwkR9{Pi=aT@(cXsjI2;1Vbql`!5_pbm&s$5)kXO!H4j?k=T_W)or|b2>gqgvDn$ z&&ef>2ZMQ~T%{JpNW1RZ!O(PO@}|PMf}flrQm@Zja7w-NBo6=;;gBG3zKBi=x4L1U zw7;Ao6cuDDrzRz0tNj``m+Rqj$2!dDv(Vz`ur&t6jN`ZLCqPWBqG|uI-3Y+Pt!2SGZBmhP$C? zBFZZAC8`!w4)$se7(F2QShukRG1ZUcjHEd8&;t|M2_jgKJVJSSdEf=9p>>itcRaYJ znWw-*W%6ULIO8UFP(rJV93?U{!hEYAq2S(0#CXLKj;M7$H%r(-tupw0&W}SI;vJ;z zh6d|!_^qq>pzgOR_Nd?)Uag>xz?YrIZaNSCRdr(ME8Qxhvr*~5@tqM{iz zwd~4T3gW@?9R#eV+!ex}ZwwwQ?NF;QVn8sm4CHJMD9izxyQ0kT@rq>EOTf!ZPeWr-RPxk_cx@ZCPbW;DD5C z(hQ4hFuiM?RV5}v%fDJRQxWwWIT%Fhny89$Z*LEU91u`W`X-Dv2j$fQTtPvYC z2u2@p*l5~9w!LMRCWm9&R!ZyRQeI*eBC8pJ6k^}n*r zST`Z0Q?Cfs)ngD|6Khl{1v4%9m`GPiS3JRIswB=cyFncPcnSES;_?Xz`A8_;Xzx1E zvv=-lto6-1V*)@&aDV~;h$6jTSN!Rn`TlQb$KT%h)lC~18`|4w+ZkJ0{FkeaQIkUA zMeco>h^L9A$R*Th`>+g5XplT-EYTX*Vzlmy*9NE0 zxj;j0%r{yGXE@B}>QS{*)9UeZ3%Sb1ECyjk*>;3@ylUYU?!5THin|RsV7-)n;Dm0o zwnhpa%6=glT1-NJQ%18k*EHBc{JY6S03jEGWUj+D)omn&_N=KY+Sy3((i)%bdA+0* zEBB`QkXpeN`%laUi}2{o+K5;DzA|RuUz?w{8k1u`-)m=*Al-&x<3tt|7*CrRqu;J*YkRS#0>q6! zgNSSW2p25g^y&M&JoH0wZL;=_r-OHUETU`N7Bv@7o#{RZAEW#WD( zwFo2DS)Sr#a z-6qFa=b8q)0~iggnF*wqF=4|MDmGWpNhwiNkavtk7gO~rc2CgBBcs@*VVh8; zE|1^Bp!m-6f9?7B6a7A-^A@-HEzA1v(EkiWy$AnU>A!;04c>wO8N>NI@LR~|w=Dlp z@ViJ2?cXVSTW$Xqa>M^oiua1%z5gTp^WMZ8OMD*@c?S^nGl{*~1Jp0@uvQ~zn=y<_J4 j-4w6y2JHT06aOD818Ff(us5}D4*%$NHKOGB_UZos6u?hd literal 0 HcmV?d00001 diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/client/modules/addressing-1.6.1-wso2v63.mar b/modules/integration/tests-integration/tests-backend/src/test/resources/client/modules/addressing-1.6.1-wso2v63.mar new file mode 100644 index 0000000000000000000000000000000000000000..7ab356ac86fa426d92f5a5b1c6c92ea30a5cad34 GIT binary patch literal 31668 zcmb5VW3VtymnC{^>p8Y<+qP}nwr$(CZQHh=WBbfI{dM>4jyusYlaW=G5xI88uBiI4 zGS}MjQotZk0ROwa1VkwQ+u+}CkpDboM3e<+BxFVDQBtOr5q*@Io|2ZLp=xO zqv|Ji@5qi)M3z!ia?YWwLBWPbN@7w(^+ujjeEerdlF3Q3|4`)podm%*vQ|x!b=)4B zC&*n08CjQBmlohZ@&fp`y#7h$KO4wDBRfa4|IGaVkAVJngn_+*k-5qL07U%nKm&IR zC&vE)j`@Frn;X~~TbnpK{SR>@|6`niv9Y6xlaqz*|MyD&`WQIA_)b_j003)3006xI zw@V28=V}tR;{QsG*2vnx$*D&R(py`l8y0;-S)ch2<&i)i&%3$w?=Yv$>iY@n%jVn7bUl_0*Hu0YU=Cn zY)=z$MsdyCqgeav)!FCInbus6@8dBrJko;U%25fIhX_N?9MwsKB<`8i7AP27diUm( zm3vJZR>#EDpNCFE+tX*p(?X=(ek@qqdqs>o`VN)dtYe1;?#<$^o#R-;-D$1v?i4x( zk1XZZEboftwaFvKB)9R-G^vwFq~63K#m$Qo*&D`n)(ZhTH>bFP9#S!w-pPF(($^IG z=p&NtIXij|1N+5eKsuFs+oad@?zVK_nNR87O=!knsZ_6`exlP{@61ZR z^SN*6-({2d%pT5UdZ&(m(LDR~?{-M{j!JZYs+VtR3jV(FCiR&=q`~y=Njcyq&%jAs z)ThPW0W)5eC-+)Es2zXj!?=$hhm|~pbJs7aoqY2>yk$=4rM(JdxJ#pJ8r(S$Tq`8? z5#0GL?b~I1*$^1k2iqQd$^682_gOu>8gIYK_)Z^>nIzz)e+eb|89&6G#QPdP$bp9B zWqdg$`58RWmAp`4y!DaNCB4?k{KTaBP068u6;J$n=1G90-z*lcv;0j3rjsQ@4;{bE z-2Mfocs{>~81}qm8}>?NlDUc`9^xu;&Dz<)lMVjFd@V&fm_;$)gWKdfYPb=f<0s6H z95#|(>G&J+Dw+uW_Zl6o=`WVNMiLjglo#@Sc@G8Vt{GYSEG{d{u3BDn*yrCZMkD$n za}i=Ri5j4HmB&_kkJaHW>(U3<^#YT8yRw{f1jP(*tizmx^Hh66LYKCMq{|rM3_&7` zE7-BlLRUf!yqinO^@(Epy?6@Nu~m+5{C=WOCYoBz4)L^{D{0}6kTy@Z!Aj>Q_o5>ywyo7*@)>mjdXD3o;#toUO#b6 zwC#u|ATiMWS;rYx6FbW3NafdAmq=tgFvOvopm@uA%(fNl*v1r z=B5@Qa-~+eg&SZ!>H_;HLhQHY+L{V&G=@upjSzO<3lt|l}PV_@At)Jxm#0m(OH zNE0AJb(69P%v$S&RUN#EyZI~rs!5!S(XIMFa}Rbx`MGBm`A`gDoB*D2L5E z695Plk64pn38d-Btr#ljkaO^~86SG2!D8naT;-s&g+PC`1ZFhMk<(iOES;j^sI_Pc zF}ryaR=ylJp>0%M#fKYlK;Ly8jPtkIpvrFUVdeCE-oE$CqP0MH=##X=hsf;utt~>- z*XDlwfIh})V=5f5*i1CF{6{!+ExKzo{DvFNLpodb`uRagKr&x69o8w?m1|QRPN47GC7-YJ*uw>MF*Iah-KD^`5w$^`;9kHv8hd2JbIg1b}Qf?MmXKkVqjYm38{Rsf4<$UT1H43*l zjG9w6ZqPS6#M!mSnKcDFvD11|LI>ujYlQBB59X(AgzkO{tk3Yi%6o7>39XNm3$K(Y zlu)Wc@RY^kEujWCT)5>iE18c))1m_CBtfj8Br@56LJ3uk4c;=&Rv&{7IinAQ}Kjtvb|*AylhzlTbc0_ViER|_MXD4UW5C5FHWoo9)JqP!c zqSLbWI6tlwFmgd9HH#c*hG|~vNTYHKV?24O&S0b8Gf@Ab;maVDRJCfh19>>y&K(E| z8-Nf3z9`xdqe51RWj?$13=7)azW>NGd4;BmS%oLd-k~CGlRKtdt9v4M=}`e%c)rXO z$TIEV>;*_C2|9d4j)r-;NUCOas=D^L2wIkVxs!s5R7&GAqenIw0yC)N;j?`Hj_gIz z`lfEy3G4jH6ZlgPpsU2W($)M}39^GcHd2(TmuPQX#f>vc4KH@o*vs<>c%tL{6itiZ zKz^+v72@LW-{mgwWRn1kT?++ZL;m*6M~m(he)LicWRa zTvk)(*ys)p4#qrvP4~!PA{2F^MRK4k^gkQ*GA&as7KQ*%uH`fHDN41CvpFzVF4hTg znf#;{HA(5iEA{W=j$lrqVM7OK(hT9>X32@tZe@Ie8*1`z;i9j zsu~YVhZ~JP7Fd`Q9~AN^;l+u7IPOEB;DeA{`mfJITEGEt_by#T4m6_y!~7_6YYh=U zWj>`&L1klIxO8Z@jSSQ<$locxern>ra zcEwF<<5!_906AWS6}mDL=j-~1DvyiS`*c?ig<>v!vaAnx4Kg-u%O!?wbV}oplsg3p zwbq*YnGM8yxZR_NCBg>EXdeh&JIv4gC;jMLMe~ zsZh|^;tTam7w2%qlELLuu%zjy z*}FJD@%d{VFSsoJv!cAAm$PE46m)q5*W*#Tr5$A%rLpt@M6@ywCXPmaulkLiSITg> zR1e!^ryb^a*HPmdM530aY)62XqbD~lBk!(_hs}L$(^Ic0Cd9;^L(k|Jwwj0%uKnAr zH>iAg5+bhzpHpMUuE#j+DoJ=c9?!CY;-<|iyPxdb zQmvw|TZ#qBcn_r-Aa>6479M=mbKN$B2#7JF5sEw0s3G3Ox?rZ>v3V{B;D3qD z@bN7dzEC&p&>^CFv#d0={^6~{l7D`!^dO)G+Kw|k;!LKw#7XH+O{?!YJmy^9z?tM! zntC^5InI<*)J8|7?Z$okr~ok16Qi|lthg4V$wb3xna^_UgcDO+X7JL;VF4T+5#$*BXhT(Lq1|w)Y5F?9UIta$YsTP>NZCST=25_=TieUp0 z1kMj_jYSf#T@BlE%;U!4F(-$y@Mp)-4;W#so}x2XRLv!W$$x7aQ)R`$*Z{ zE?ggBThDT3o&p0=g(vPs=%KXKNrCg~oHZT&Hrh43R zwOKCHM4+$QO!zuL$H2%xXJqDFw8Na>|CTG9_KNXOsd|PIoNI$&OgL8vy2pt+S>&p- zM82cPX}}WkkxU?2c@_ZJLXoS2%G{9jGrP5XjR6lV&__@InVU6w3-ty=!XBf>&X+Ds>d6dq=9*|y}0JW-X>yJjAUV@ zK&*GE#m0E;{jGN%N|;G^1$oNg&q0IJ6Y+-20GGLjVZnsFK-@mKh%K~u2*mABUNPl5 zjmw2^EqI6|*N^{)0}W#T1gX>ykx6;u@i)@i7=(LyY(bhc?}qqFNH>`|&k6-Nh^B)HC?Hi9f*o9<- zS1NY*MQQnWVb(nk9+wafZCj3V{8cG{oBQ=r<2R@*j@zAfzzGy}Ns_Wi<%y+PeOCK} z6KAQfi%T}H^Di$ysHdz`{RaZ7>Swe7Bikx=>0zq=wZVg7-eP0{VVTf^z=yq=(U;3~$GPY~`<{n!OKIuNfr1{jJ# zKkP~`5CFS6C1~rHbrEwMP@=^7eN1$ zQcMMIF@~5puMWxwbX>v#hj?ya7bALgp(D4JJ$em$Hr!ob22gXz>AY%Xkrck|R{x`k zGvakVYiBm+1=M9x4oaDAXQn5!XchJ-Bl-?MUol>Q2cO8r7-kW`#uM@f#Y=Y3dtfSf zlhnD{lT$uj`+LPXF^koDL+V13xcR^#mfxnD7;b%zIV2Fr*A6%QK4@(?JKBI zE@pMeCSoORe(ENX@{qHCtVMp1M!wmxxF!wp%$jZ}+rlsjJWyIF9Wd>Y~u{Gv6t+rXqqfxZty9J(->>`HR6 zrli2hiy+{ufI(d;>=S8c`Yz0X4>ZUl=5%N3uK3zQ*oDoLLMP(ORZhJUo50mB?7Ihi zPQF%q^zNL%2macEudXDxJC09q*SQjQ$(Fmn?HSvGKyU8N{_CR77h-4DZK2nj!nzdV zs|!7rFZonbeJE&tfBtV!{GUkbQWXFaG0^TW6`JEn%Xj1_ly5ku)ccyJW>rAMFAL)y z$(8sgWEA@I*Z6O>^TNqVR2ERFKoS;?!Mfw6Jfg2$&hQ_0@&V)hUg~2G$uk?^mjZc$ zut;`e`|)FWhOlmI%7b_n1MdxF%9XiB%-63xF@uivThszazjs7UNMMBnt&_TWL5>MM zT*km&70@3>zly#)1ReYM*bhuc&zbzXfuyBRhCRzRH%8B>pxzZ!5sn?Zmzs%;E7*_K z;}_ivt*j+2q^BAdM^Cj+OefEp{JIAEGPl&aiR+w0I!@UV4C=@)k)H>FPW!(DYm(oi z4B}cA1BJlHuphAQi7vj6=qevlJm!sozDu_iJi;?ShepSbX{sn3z)=kLJ$>isGZgG? z-hv%{=JB+hF<%0H3n10qfcp{ScHO<%@Vzg^dsSzX%Zd4WT2UP|KS(>K>^3BetCwxg zS_Mm{5?iEx2lzVP{;6gvC)wC47RV|T)cvtR%ee{?WuT>3^e!OZCM)@VO`p4o&kl3) z5OZ~cy1k;P2(yyys~GmRO$3cA@)4jt;d0ZE55IDK~?svqhA2_DGF$;ZR=D!KKMSKg;Pt)VJ&|^=2n4zAE}jV0^J6{ zzcCJEI?QD>WfVMRt16On!Pz9!a#we|#oy2Ap480sLKp|u_VN!?D&v1*6%l2WBXx&y z=|R6Rzkx}TN(arpkxL9S2j~{0$UQEseG_y=D}qfQp`V~6(NrFro+zi~DQNb~E{G*f zHc_+%kMxEDlChpL1E|HZfP*&lOMan5zdY{5(s2_pd01^enk|+{`-DRuV(Pq8V0<%7 zl~q+~n;mPyy+2&5!{KCzJ2h^hS1n;5RH8zwtM6+#rL_)pDn+;=t-N8&FKZ3Usx*VU z+c(vl^C&A@8uN`#YJeJ;q3nH`VV=4gA=Eo!)co5rSExW^O}sM`K!tRq{I@ zF>2nl$JF9_SqRsSk6pj8vI&%=z_qeez@eFVLY{7PWWBFI)9?JZUH`JsdDwR&JUj;( z;hH$b0Sc)FOS26=(V4}i-@>eDVFn|W)d_OkOs7#FF!=_xhH9Qy8j zuw=g;B_WVVpo(E!cr9i{4B}l!>RI7(=QIktuqt+*Rz&v7{7&FOlKM}IyVheD`IMas zT%V7=k|4gGG}bG&1-sf|ue-gp9#Bw;Wq@f>iv4-?)2o6Cnn3ta1 z(HoflgDYp)9w2NNB<_!nGf5x(@wT9ZFQ3i~UVa-R5YcX3gQb)Dq`pg0YgVCO+QeH+ z;&5V=5cecM?5G4NR3~zSq&|_Q_crxnZ9;*(LRD`~%{jLKhHj_gitItM|Mc|leZ31- z1!Re9T9+OX3StMSyc5YpkxP)7MOE+1M1oO^O?7!~9!!*97ft!@`=|Ujp!{|$`E6kG z8&H&2z(_j4$WK7fD-=916tN#*d1*Z8NVXWTkt{jr$hK@;6nLP>Fo2OE|3gIndlr5N z7qH%<`sKrqS3ZHyrpcaArRrm^I%(DPIZ6 z7ZYcmpX{G|y7C-939UCZdW^mTSzn+o9*NtdGRD(0LdJxvxS#`dL6yy5h;BBs{T>eB z+nHL4#Kfb7$qP-`N^lM3$T?Afvwkg!+@xlZbxD{J$~#6>8j#jAd{O6mA1<)TojIZl z`+dM-Av+_R5uNRu_{7m`Q2~u=pPJk2uyY)-^BnqD5zNL9YU3tH{4R;9ZA8yMN^rJ` z;>{ns*K~_F0}?+~BFuY5Yns_QR=TsAw>XWdw>}*XLsmE&P3m#|X>ai1Ah`ipZ$vPU zc?huFQc-VnD2HeEXmd*@Uw^_E9@l?B)1UhSj{1lg-4Q)*_|EBf^$yg|4NfMEJDd^- z=1w^PsD#(0u*C?1uo z$Q0LS3M(8_cCBbUiLyl5Dl}abS;FBcJ6$-a$n+_?JQZv5&y|NfWorum%AYMlwlF(2 z^K&@4lQB`cF2a65CG>(0EHgvmxn`!Im7005Nhu?1ngtQOXF8vih)RJbDCB#b4L*>rNF6W?l|G zO~@YzRJyqMNvfhxiG8K>E766Q}E3?Dss_ zEgY0f3K+y*tNc+4xWup91e9h~>ev(nY)P?PE>W(dEh@Q`?Box*Fl<2%T$K4#hSw<~ z#2_FK8_@}G)~3E`!C0;p$vn+JRaYyK@~xR-l#PGN|3a(Tiyg@k3#kieC(P+YGoSiQ zpEbZEdTS@aJRzY=a!YZ8SpMfsi7nu*GnLa_ZLGnjnnN^d$xUUYR?SL+O}ciXomsAi zJj=bg%<}f&3iJ@$_@KCOJmfRqk0G=2kXh?_$@>|sKQTXEauJFpzd$`Y=ZwfVx1wmP z0>xfL*xLs)S*4a7qZwtRY8wS&>jdenQ`dBJ>YO!UwX`pMdKn!F^>da_+RZzG8qs)l z8TFzT0U>@1V`S>0O|u*Ne2sptkAM$==FnV$VdWr)lJdvzKeXn5$*wxbs*J<`XylA& z005%@@3O0^fwhIPfwP6(f0tiN)F8c4)G&VGIZPX2P+E(b@om_#ASM>=QIZ^ku}Mk( zYyg0Uuy5e7DzP$6O$WzsYMz(WYU3RFnZ$4|V{s8s@=h1t9xJ?E+Pg{ZyO}0b+au zj<1*Pd)|A;nA;-E#2h|b0k=bf11Iwq@0&I}p)ojBrFY0MxBby)(k0XF=Jn^YFAHP~ zAHWiMBxP_)3+zJe=I~!}j|yx9yJPLvncgef$AQ|d*w-<1Rv-0`_CoFE@+WbRQ}+>O zex-8fr}mJC;3?kkfx<=Gd5xGTDtrwOG-AY6xl;$Y9Rmk?!^cg#4_5c)_D6PC90)`4 zRv*;|AY&jtN)FC$M@^F7Hr{B6Pn{>+@gz5Veo`+*KFmrt7!{OJt(Fx0SqZgh|JzY$ ze8CFY!J?|1X0MQBa7oj{qtm%l;4;F2Y~4tx>78YYWq2ib+PM=-WUw@D(+nJ{gm}3+ zZLZyx6OR_N*?ANWTcxyPqq!Y!S!<91E5Tt9ZgA7~a>*#`)Fk>sl*`|BLu}5%ri3M< z)Mj;rhi#-ZiIH4|;^f(C)fZHZI(4X|NV;W2>5k8_L8x_;VR2{2a2OgXpLT$*bL18w8dWmNQM|77~=_7Y5My#R4)?X(I`6Y*mJH`m#8NQW45)ai)dg(rU1+7h2-% zW00%_@&gl6aut!oZ#~GMY8}qPUswmINHT~k$AOMW%;m(u2z2qk=%M}Sbk@#`k2bBS z26AzU9;kR@WXj4$NzrnZZz#Db^j_6oY|oeuag|hwVpWap4BHwyT3fpt>xz4u8avCn zYC2s-O*K6&rL@?!RXSydFuXLGbLDT;vz2eyymUvgN4l#C!b0B&oF&e zZ;ACcQ*V(_uxpj;w3&5>R+PQ5W+vW3BW(9HkSZHMJ&oxN%#_Yiuj{IE_vZ*@HG89O z%HDtWlLF2*>cxmEq*aqlcVl=8t9!v2dS*#WnnkwvFA^GTgp|o>;wQ-3TT$o#LXp$MM{JIJ#!je^QeY$X2hf5imj+^j^!+LTPR4QUz z+n8;x;IMr+@??a0IWO5PS*zNSuGvg@^>%ersitj1H;O8MMq$z*bB=lj41dm%$kxhj2q)^{sFtx6BwPg|@N zIjamm=f}!#8fKg=aV^!65UHRnsPIyKnH!`;T~u`aY+p@G%NeJ^<@E;RGQ2RawUpRh zYH*xf^YoL{OxzNpeOZgeygKCO#M3FK&=ka?8O%x&A?U$HkGLFx8G<7p-D!J%n^q1>3dnwn;~?}kj1+}y(7ULF}lhL?K&Vy*6Sk# zoCKwFLOi3C$_zXZNb^N|Oi9We7B22b3rtVr2;R|~hG#^@2_nvEkjcM+sGPZ|)NRTWiO|gYZf;&tA)KcRNULiub#qhgZAQ|YRA1GMw7Z#$iI?eJU z#-%nAOyh**r^RUCW{)kHgek~lc6&pNj43fI8**-u3T_D2H5;)ORF@8^Ew}R3fm)iaa*b`L{X+HdXfpKCU&bihUEX1kE|8q)yZlYO+$8`5xKea zGXitlea52}ijCf3#6^4FtB`w|571+cYONDKi(>T?Hp zlr@@&)t``{wxOWG8fIKbP6fk|HbEiBbSA9D>5x6)($mv?#)5oO`hW4Idup1~M* z6wJ^Lzx3KYSsm9XoA-ucfnN$sejI&gqPr>H0mFzc%}O;x|eRPW#M3 zQFz!3v5dsGICqG;@ewI?;@m)tGi<}VTU^AV5v9|W9enl`30odPn=cqvj_|fU?QGHG z4(i6xqk|#9lsD+gW>kqgLS(n=^8xw?`oHtU4OmX^|Lw5EKnDQ$$D#Lcp2UB59RABl z_@BAn~!~SILYT{Wet*4>cf?iB@m7+Uu1x;gZ z8NjwlYDEj++{htavNau=F1Dbdq%3#G4_CWKE5XfHQ38Sr-?ZeBANUkTl;c)Vked3P znJy*Sn4$gnBw@PkdB3^+?Ro9taXst>2cSk?B2tg}M%0c`lkBF9wjy+g)x{e9OI!8XVRe(&)7CJd4{Tvphw zBV#v)qp)4EdNa5qdCVg@Q$WreGbirN8a+S`cclAlLLT|Kd`^F(2EVi+`_= z4o^YUCm;6gu6`JWq?h>C$Zy_ak#Qpev=Z~!3bkB4V+I>=Pg82r{QT;Q;aawvawO>^ z#andNdf8fWI$#*HWyA^er|tOqrg*o^%rm;Ucg;DK*vpwJi^-a-!mO$FfW34jM;abJ ztLE9$Z+2%Nxuy`cw1up1E1q3aW(M2Ld2L!N3$~2Tj$^r)MJv^yZssD^Nd72xbb*q| zV~XXab3*lUzAL8X$9biDAvttK<~1?kgQMtqp-_F*-i2u`naLA&3YFa}INjSW(eJtj z5RfC7g1*BftyfI$rOT9d;|jC&=9K5v6NblX9jHlE%HhFNud#@y$00~e$kGBOId-dJ z@K~f*=JvU9e`4+e#w^T=DY>}L)iu%e2EDMy+^y2weVO@q+i^Jyc4tDXxK4@TF%@JM z6KBf#fJ$O0^q(E+$*1{wHp4L+sPb|7&INR?#w_-tDhC&+X`Dp5LHlck`{zVe|BMSR zfd=UfH_J1Tl)G8CAvu7UTNPCHItf*|)Gw42& zAXZe13Ab%bqn=7CZ%>LMUE+WWLn7_zi7ejWaZuEFCJqaiWjnD|TD44OJr)PG`uYp~iz1Sni6c>IWPkMBJMrlhoMncL-fH<92}$X`0M`}imZeRr){ZmN zik8TzfOg*koXqwjJ|~REiVp{*o}-2 z^cL+-yLn7pITr*mra4M?nsjMBZLtHp9| z$t?Pjta%}qB-?pJ1>cj-C(T|h-Z*eoAb&$b$L^(8tv4i>@2I#74%XZihwSdO2<3)u z@4R6B`tew}L--IwFn_Aee**iEtc`3NhHFFn4sM5=Ld)*qVSk7Fn7NCpKiGbR*sb2^ zVy)cK$cSYvf!vb;)`AgK6qThEiXt=-7lTm@WR@esQ50m%q1v6Kx*UJrhuHOHViWA* zisFNarzDXXMkS+>k4n<>BO(fQk&}jvWthV$qKnvz)JNr%ST~wGAHG#rf%!jihgxT< z3nG|Aw2_rYm;+dT*D9p!Bp=JVu-8nH!Yq>L>P?H;rSvDD`8+^Lqd_?3W**ES;m;Yh zXyJpP*p?aY?Kdk3;>q1IABS;w5bBMo*yTZHE3ObI>}(Ib7dm0xw8S`Zu+fsR&QPt$ z1V>fAJ!1i^&AG3gyw+%mhHNhx1IS0RBR@G}h~z4f%zB8oNVdh(=NL3lU?}6 z9s;Llah3E70w6AYd_q%D)z{fKZx;$6Sk+h7+TVdtup%35pM|z|F|WL~v7#`JZA{BD zlj|?uu%g$zm}*^;75rzi8F(;lQRmi|Q*CWF2a0dj=aY5UnmxukOJ|*(qWYQVW_u)T z6(pj1ii8A29g{4HCf4!|%{F7ZTEk>*j}Z4?)2gt>^r=o3E6~~rjIcVbqAQc6rdWkX zg452IN#|YXuK4K^I7|GG6JpwqJ=RWBoMTRUa^v0smaUsRvfiOGsn=fcHAgj4oKxxp zqaG)P?AL?tL(bv%XeEzMl#rkBsKc_`^T)#1QE6+Yu=CpT7;}W4xl?BzV-Y7gxJ*a2Fh}O!W?4W3% zVuPMNKAXX=1_@L2CRi1Vsi8g{K+`dLLo51QPzyB-#~uNgq?;?(Gv2(B@FItnXtJ_a zXi5Q^B#5S8)TsQm?U$(CCf^?lr6V;T%wkO3pyb*sc~wAdQd9-B>_v#?PQ7axaYe*) z!zMG2Q6)n%s>kOesjKX}6bd34%dl+z`LDXuORgf*q9UCD$hcR3TI7*W;&&OAyRv?5(bNJI}8!P1{I(R^s!4c?& zD6`}82BzF^y3Zh#I^sr#h4t_9sQjtJ0`fWrPA?T*N~y=F5a&jTgE_dO#O8i~6EKgY z5x9)cU!F&ljtL8;R|0WlA+b&^OK@(2Ry?yuh!Be{)SWqnf;r4qe#1YdS~!Ek9(dDF zj{GM$8Iz6j_6#)n-d=k*>b=68+Y`j+ev^P2ze4nOR>>H8W0_Rtj$AZKEUZ3#)iAWs zh$<;^#K_V?0`-lBHMm4YegK9#+KZOv$iMEyI|R;1gt9gNXVBdmfeN0$g^fw$+T_E4 z`t;HJ)Qy7F5Tn$P14%ugqa8r1K5-7E6_H*iI9ebUo8bTndJO?~4H25nkZ0)Aa61yV zJ!-uDPugNK8n?eH_J}C<5Gi-yOn0!`o#%E0Swl|R!jyZFH^yyz+M}g=NqQiTA)0do ziiQIqOatZ)VGOPVg>(aK*D&fjjr0=~R_c0OcRN~ZJ4S3f?DwJU)ua3eI%aua?518I z1Wl$0mL`Xrg%;Lk#Ilt-2-Z7`wASc5QGu`cuJGT%WF0wZF2tf$>Q;R!=1KUa*EGV> zFI~AVI-+MJ2Ns$>Y?gB*nsy*HM#oU|QMm4G6(<-u{xWU}y_e6#i|e3h-OyIk-G1pol# z{@+QaoXdX@Oky=90dW%pV-rU;M+;{Y$A1-t)M!HLYn!z2p3M=znmT5YE|uDJmSPnr znRK=lLl=ADOI=7xX_QVhV{m3jn33wNgKVHEC?JXpxIz$)XEql=5h^x^o%a2HuRZ2H=3Mu2eB39=Aueb?*AGxRUC`G#F1fk4EUz9r z!sgwaGPSeD{cYdf2V=|V-aKx3;8u!sA+2Nc2%5l>*(HX}GC9{^^oh!9d)QFiN*z19 z>j29mqdSvo(zD!xwPohezk^H4Dj^_0qK)6I<;I*T;I=)e&nk5q-dFXwNhPEdp^iJ+ zCLO^IdYw%6vE7~fbE<%$N8A!s;u-*15>5rvyLeo+-RxhN`f4Tp zlWqO(f#FbtHS(vpT{eqXY1x*wLnjkH-8+if zyQRsKFLu5IQa(K!$Fd0>Ti)@o;=Zk8vJ;fBoiCi9TKfYEgTG52Up&5~aeZ@h zr}yx097%EGaC2SnVP8ZPv6A4{jX-4d%f9R6@s06=r27a$k_a5<#NAVutWPXw+ z{8-=VfO7jL_xmL7-GcTUmt?;9Y<;tS)n*@)Cw|9|{2sVGzG%l_eC1|ednf*>Bq_*# zAmR98VEc`Vle$ls!0UPsCRAc5r2?%kr?#%te#o?`#O638Ax}1-TvF~Rbp)oPoKsG% z2tBFr-i;B29lNaTR}Oi2LbnVq5M?}R12JUyo$Y@RXUARtW0t9a6>;!!PIQ32bPQt#1qyu7K8F$5G4fMdN?r;+ z#P#=E9Xtpac8d;zdGvF3?B=bnfR+Q{QOr1f?zp0-zi;do`hAGY=kJk%v!S`K<$0$# zMA0aiQB|OUUpeOzl0R_FNOWhby0;N}bi~N_LFpyC>eepWnE#h~K1*-`>z4ht!hpR| zc@2d=-YlM^t2+?87xt8$u3nBcb)$rJ6u40DrTKDSADWS{^8Km4^`>;Gh)>5F43uE{ zwN%b<8ewk%P46f!{uDJ_XwZF$bXxKc-zo+pdE23$Uhdrb@UbSY1yEb)8rV?4M{DYJ zz&Y6OOMI$A@dDoFaU9smj)gKJ3K=}qqDg`H5pDJ&YBY4ESm}Ku7>zFga!*Lb5y{34 z(o0}=F*&Q)HA{7-Jv)L9?!%ZNAPoD_l9P>QU5h}3rA6>?P{Xs$mR2A-E@T-2jh1{X zqU9L?)bg_+(s-=pFq{_NE89)wW1FR`g^{9hxk4zWO*w;oy}ffNWvJAU$IImDgp*lH zB>gtkD+?IXrN%sF40E8nSTYOM{H@$R)^`U@MeMLTc1@?kDX@WW8RP1O)`=bTh!M*H zPC_P*)c`6vr_wH*g$`o)XArw+tM63#hJ`DrP=AwwjOXH{e7;B>a|NE&K8!j@R&Jq_ z4*u~N0jqHTw0U9gC_^ANJlX}zLO&njeU@W4*>>_liMw^eAtk;b`i~h zZzLDo(zW>gv8``5(_WHGu`oW%Q73}rkjBF1SvF@3;C>6W-re^B%omPe#!3eyexsaFcignrg9qp+k{ zINPz(SV4zA2}F9mw^SmL`Dz+gSXg$VkOc^kZ067ea3-_E!9EWr>e9m6aF84>)4v<5 zSXN+6S}nL;P_#2irBpaZ<(A%JR1PYpOoGQTnEzu3Zh8Wino(||_Kc0CSMd=!ZkarbGN?fFt46v@*`YEC>S5Ts%3wPCFr}5&%C*=f+tGGH$~@#Q1uPl#qL3F%~*57it-f}qhZmSX*kFD=q)*|^a#zgs{pkuD3L{Uh#l9@pwTU?^apJj zKeVu9AOw@5QBb03QO=oU_7OL4IS1v8Y#%ZNwyIbX4qma$C`pyF0kwQG@?0p)6TeSH zp(~Q7TA?hBlr!$gko_*cdWEd_mWZMi)3K>wfr8_;vYWQ6SX#kAnH z9!LImmy3iyQIWXTQ`C~aMXy{{bg5jHe@?ZGH>y>s0(><7GH!@NY>%@)EY+vf3fH)l zZkat?fML<1Q(}YYW2;m&ca*qYudEz~tC4i=pGkX?uC0`$Zh@>UWUXp~X&F(}GHGcF ziJufeLz>#1r;HVMW0?6J_I4R$yOr;^fNx!9Etp{|#=tb6#pQ@#ck&H2S`m{(;!uGE z(KKmGTW{?!7AvON21z%`J+CLmMHC{56Sn1Up+HCGTOGQzO>1F&7aAa)VU@}mQi1UJ z#8*%6nk?C}H<40;uGAbT#yg&p*U5}wa$AH@3sl}vOA)d@> zqeRu#qRe+iw=65kRGC-&Q?8Q=Re>fHa2hVCS-+*I5Q2)I$l3zlE;Cw_x>@ytVcAzg zi$bqcOxwCl0yI-Fp;66^ZCndsn4?3dzD70Jx?FO}l-eo1yk}2n6gBn;BBeuXLmOdE z^Q^Ix2VJ(T27~NIW^cbN#H<7b3=WJ zdZL?!3V5__kzP;%&NM9%TB2ICS`(pzgQJk6?(t)&vUKC8%9kp;T~w+n+_ zr*-My35sYYW37W1Dy55K6O?SHvd2GfUa=MYx2=k65qS65+}}RC_ltl9X^UPaY5;tFv`Y7uT9D1*6N;UlO zGo+U16CGkj3Pc*sv(13&OyBh?uqb{>Z3I@267TbaG#UIoZROagE5sBtgN>t6aS3SZ z#GlBkZHlcGQTqO+S1`zkUwI}HeUotwtfhL~35>+I+z61sKHjK}9M%CxSrB&ln$rH4 z)*M+Y7jl#hEb~OJY*E0$<_sppC~1o8gb*|KPVHzgBP!#P6oUZgq+aU8U5Tt1f*g{QYnWj*(%XJH${G8m_zN`e z$^D{zfO=PUjWgFiFnS zQzZO@wwFx0b@~e$jb1XF_%3Wxq-o8em_xr7_%~JVF9~)=pTpLlZb_5C2FhoOg)Nto zB|Mt*Sy!voaUjTGOb=wcaM#;wc?*tItH(G&A$QAaRb?@Udx=G;HIu}l^_y9R9a4)I zCfA^Et2GkV*|~66q?2&Gj(H(w7$@4>24rK$W_JtXOfhL+@@aNAQ;AjG<6T{HvHm*5 zf{?KapVa;%?ubLqYNE?N#=+?swZb~?f|;2w&d=g*(uDXl^^qc2uIwQ+tVBL_y{jac z*EL9YG2-{;*@*=ey4*z>Bj=*0TCP%mQt8EU9ou9$pDI~z%#oERG18Q%3=z-`v>ptk zu8K3~5@%g>!<=@F4S?Nq3++RvH*{mf{(;)tGks1V-P#QY)Iqb@+#|C*ck#t&DmN2P zF#us5^Mu3v;2e?G^Zq#1;0ap?!@sAo7~Qwp6#4_}Ue-eS{h91P7QkvqJrg0|UJcvg zp4%MEMw-^k6#B7H4)5{}(~QwM@q^E(N|^6+&(DswjSB;M^jWpUyB$M&J@*=WE>iJ* zKQ-uTf!CT9_A+s{WNG6_M&{^f3vB&0!ScUK`wFN$mTYU>-Q8V-ySuvtCpf_!f@^Sh zcXxLS?jGFTgZoe3eRpziX6C&&>n|4lHLTv}RQK0aU8hgg-rlQeZ6FkASGZ6&GMu*4 zJ$U5xoenPGWL`q{%r$CSfgbC0q06IS>%MmMv4$RwR808ESPA2%BXC1lN2~{3hQ^|` zsmajTCw#jUrweW*cM{(td;DL-k>`HAZX|#DfpD=r@gl0RLg>~w|DdQEO<9CRuriT& zPm2UcvUn1afB76Ici~a(?7)&$c!I1%dVdfihIN!=bsFgidHiVBL2vw8!{VTvN8=pP z5e4Mef9-w$L!1J|)WJ6#xm5=#Zj~mtVS6c zYdUHn)FM+;W%pj=5)G4+>K@4}{fL(3%gjDM-hUqsytqe19PD3R3%xue;?7N=r|m}` zio84rU%3ytcARi~Nme4Dq714@wV@-;lwRA%brKAh5TNfOUdpW1$SSV+#qI9O+VO}k zp4ROm>^j7D&&u8u;gQ*o2n^pewNhC305WRf?hGFhjWEH$iqIABO3`YX_vR-M*8|Ol zz@lg?f0w}%S^FW2wMl!P6P>QSbHghjvdSD{dpniREV?GORH z0e)zRqg0Zw(%jd)$}AMotYxl~onJN_E;1ZBDeUT?Ai@=gx?j$9>0)p68W0W(GJeBItcEE7U#E-LkS&`_05}W?KR;E8)A=4 zziS$?1Mn5miA#}dZm$f_K{g=6x8QW=C~SL^Df&Z4yBS-~^tCKqpOl3I#YYwZW2mnO zY}Z_2@k?I7vyuy*@EFF2OZf8k?;C}Y`Fb{mk*RtK$QdBNSKF{3k8xxSc3%H2f|E*dc<)yce-$uGn#^U*mdzh`Qfmn#-N6UWj`e zF7?alq(D#q;wkgIy=pQmbSRG|Qrha0Kzs(RlYRDnS>4`LM(yd|bDeReNh+08H9LB*TX;Zz3cr{u zQTt%*0SjIB`VYfL9yyNpmj~F3rghc7Ok5G7ad0 zczPDK=!gt7%h^;UvAgQOa|RJ!LtWfl9-^qFE7>csYMy2R`%y~>)E!J_kCSTKP2<~V zLLa8$goP=xHGaS~afSN;DHkT~zhP?#zeQl68dmJ>$XnzKLf$jK&;xRVpj3W>l z{uHMLtWju*Azg2FniS}5_+0n|7pGQca1BeINT}SDnuIu>dWUEK)+|J$Z4+mO(OONu zZEuBmDYfO2now=A4H^A0IR3j^6ylQ$+${Z!_Lh0NGqzUtCkRxOR_>>e+UC^TR@1Ba z5H4AVyrdeaON7g28>{{3pce??2I6m~d3IJr_!;&b{GqPkD)vm}K7K3TT1~No4!EuI z$<}0A89eFF7e+sZFpcGtru6}Z_Ay6l1IV+6cOO`EX?0gw1M}NgHG)9bg{UW4jV_NXbr*e2jwP>*ADr&Fi=2P2?mvX z5xDD79Y+V&9)_XL6*DI(;c^2&9euZqlG2aMB9SkswOoK z@-(?#{vKNP&2sN2%Z)qjDq!bHln&(RlU46i9tW&-DOh)W%bh2{2XMV;e95CXl;M3u zZX~f}G1Mw2vHDjwvSz!6UewJ#7rXSXdCs$~O^}PoVLsWJ?qq`vB~E+M-u~tOY%GTm zThoPc6Q|*aw6p|&_ikH`jAQw@yKBE!#<8^WPs$^)to6exCrG{O^D?^1d8g)}7$38l z{0>oLAi8wegZZOp9f&USKP?bG+6@G=wf9viFQB*LZHmR{75h?>w4wjV)mz@yTSoqn zn@-Re`s^Mh=ni3AmrA!seyGSRt-Dot0Opxuce@fL*4U_&MN?X+HFoOnJIzkOMJ*LPZe5$gzwq=oL0)8qi_sxM|b*S90l*|+E z_8DUKR?Nmq3~&b>QR5lp_L0;dm41fKGvM~J)PdzKtzvV5AYOO+^qF&Y#Cp=>`LkP; zSJ2MBj9c=XaOG8IYzz>5tfFf#VDqd+anm8HKdG3&fO?){th_y;0sU4rMqD{5OUmdr zGt~FW{&V&*F^=)!%%oKzcu9nb?}Qh4brPy7km9=8BFx03Il*Q`Eq#azij1ocrT*aS zQ5Ri+*EM$F6OD6f-#5EYRp?S5h&Kq%FILQYx9RT1u@6()>BiO~kb_R|x2>vqoWEW+ z7lxjd2fezN_t@*AI}%LV>+Q%)u~UZkKkcG*#f#>-oXbqdR5($`nmcQ%$lA*K$`cC| zO{M*@e z?5}o>nNz4JX%eSxIYeHUXk01aFxKZw$IFHf>+4>-8a%SA_D*Q5-|KeX&y_<$_8|L zP52zB^$sMaiN-RMnt_Biu?@=f`cis;>J1YG^T3ts^WnXd257;AWnmC9mB!vj5Zt-1 z(^(G%IWY4MwcPl6Uk}INLR_=It*4w*+0`q>wy$usCydAz-TSH2nRwUrUqy96zP4GztRl5{ziq@QAHE6$aR?+Q!P@;XrykQQC zt3rK9Td!eYj7_u$skcOv0gLIfiDg0Kzk!uUn|iB+YKN@{c1HA-Ut_&!a#^DHnsvf{ zrEi%Vza8qWy$|{tH*CXz5ffhs4U8THf;Z3h$iRil)u1Tg31bsL^7VeAS@1p_nd=mL z5P)Z%`fWsmh|NIky4?>NH_B0)mwU*|0isIo-i710=izMnwJGrKzrTq}EW!l3G6 zPBVdtEZ6CgZM=GDSspee#o=gPwuL(zuJU66f)6Nxm-rMv#OXZPWHYt2on#?#WWGg0 z2c+VDRQ7m2kt6TzO{|<{A!teTd=c4Fj*~ochQPJREa+objP!#y6qf^rj0wk3zc6QP z;(=lA*M=X8yehdlEVPRhS!I!=PQ2mzP;!k*Vdgq}Up))^;if>Ih#Zpa5#9LH>SkLH zha4u35eZ7r2Fa!I<|Mc0tYp?GzC`D7lT9)a%)-HI=S6u^>c}cqcwffCP=vw}v%Ju! z(=)K`ewF-iK05Tm_xHqQZro&kH8=o(<~zq8-~UhI^1l<6YM-5v7f@FXq*AK6y%BAF zA;36nyR13-^Mhqf!z>oa5@7EIY*VJAnFoQ1!x@=+3M_SGVhdyrxGW`>$Sju%;Fo|T zK>erVJr9Fk3+PnuaED?nDf_EJ&~uyjGrr(Go!FnJzpXs%WCDQMv;s1A;0VKK#9pF; z7W&;&F=IkvN`O)_ltND>6HKea^mKh>;6@h)Fa~BEWbF}@?Y|PR7_k2|j%FPJr1rem zckK!)1(ncu?;BQ0c`u6abm{B6{pnT&ls>pPv2OzvbR9)hN9BSRv~tKryT8%TbO3wn zG965Mt5u*axY1B6uIhAW^rERE-{C3GvZ;kuAbrr-k;~XTB9{y4NQRo0kkM@Muqa_B zCe)4D%!pBSKG=@T(r{)b^ToL0Wm#pZe2Z0E;jrG_g~K*39c4Y?l3LT%DIQDyada^&Mj5}O7iVWp%Kef4QUiDBnM_q;-Q+OkI(j$-}rBovgT zNo`^HQ&BE*=ARz@&vuH0?$YbL9&HQbb8 zllNBuG%eZ~{|FA-gb1Jn+Ma~p{xUg8Hs&swc{@ElN|Y`UuFZ@+!F8sk8aC8ATO~zB z_JdB%vi>G*=*Gx0(-KkxG(pniV)O;M)KXiCp)V^zTCu#mvQn;x_!QUqoP1Y)nxJzYUw>c6H^I*uNII1ox=7bqQJIA1rUM3mRbkoTobK{Mdh7r7M7 zBeWtFJ4_TeW!O~q+^*k&hIWA(hlXS7wWGtwbRBtWj$OA~1$BY@+WamOeOHW%7tO3u zrGC0hCAg|iFz$c{l1mPStJGXaa3)46c+-EuTITpOx&GGMyh{$|YekN?A63P6U|1>@ zZ#OOEOXle(_U>Ub31`)b53p)-@vbe__Ng~1X(7uDcklCidfg+;Txa4hBQ*e59k=7E zykegi;rHv#@M_D`tXk2N#J}7et|%PCyx(w)J=~<+9hYV-I#aa4ri8)+w$$-#H!AmS z%DrB&L+x&*wvX=fW{)=U#%nC22RQh7hfY58Ax?)CcBV5Xj$-Ad6KhLwk&3lDbwf7B zr)|6~X-wgHn<-^V_T`+HqwD7E)O{#YE+F&rS_moTIZXnIF&jLgJq=6M(rA(R-I#a* zD@TfMM45CFK{7KM(@IFU7Vb8#-D5Rg*HdMUor?U-983%~)9dhc3;q;YyLN5~&~9gf z6D(ia*eSI?_tojvRdm2LBc=DD))pqX1J3}yJhYLOD9z|qqYwiX*fq2+qq8y|-0{a> z2*Pq&KCZPKK79vzo9l|fwi*`7uXZL;D;E4$(q}|GI zx?cN^v)VVx85>L+kU~9#QFu0mA#IJWy9=5DOJ0oa5;25bJz?h{G$`OoOw|jie zMV=A<6at7pFq6~=v3Jh~4_+8GP^%LH+{Y|Q8PeE$52RF{+dqS`R~h*zhLFpLx^HR_ z7sFuA+U*6dkEt7H7}iMf!reuAV|%Lb>J{i2D&HOo2Et+AN?jNGp|9P7i)!(#*bp0v zY3vNhsXPyBX-okca80S-ZgN23yPD`#);iPoL(COwm@{po4}yMUuRt0+p^>xM)Yqnf zmf*nJ*#qAyS5TJ*vUvMm1$NPvuH@XZPRRzNR0~tN~82u zqU$mxdT+pNOC2$ zrid>)>tye;TkW=$P_9s{Ap<2htN)JG%Clx4D6Vsv)Y-y>GHsF{tRa;GOZWiR!sqMY znBHQV1X|ggVKfk&QD&0F=ti0R4IWYr177L&hQIgiAN;+4tf|EEl8lD~0sxqOC+~%S z9}WD2eppscSwcvpTv^6?i65a|bBk}3LAhW4An2eSHioa#D82UsqMkKA2M2x#TtA=yiHucnr@eL~vt&;ui}FQaJYFi^mrLo-Vs;65#cr5tQotdp5;J<_*wuX_`V|*~R|4 zqX`$Tv_w)ER;r8(=1HQio{j(_p@E&tgWU}yQdC#Zh?`SMEEETg)XY!VW}tY&+&j+X?{$eIt`m$vx>n~GTXMvF%eHKhuWbbLb#{R|g#; z)KB6v=Mc?CtNyGd(LF=?zR;7;uHCsOJzFq?dc>6lJ1$dyqO}Lw{HSVluesbM_*jR< zo(h|ctp>l}0Oh;14#rLSoLB`W1Y9Rmt7)o%x_FS_oJ!m{qp?1B*#nfTIDMn|1r%l4 z5j3XpsQkeDipn+C(4*Be3!7{7zYip9Vzpl_-|rb+8UO%CODlE|utru}k1 zs^?whce?^5Gq8emW;5*l;Od>gav?L}W-GGTAkr#=MzE?uI)adw8=k~=pFBh7M^%{u z7KxL^+WjBt=V^V=m(86b^dsp==Z?jkg*x0aymF6ZL$wzGQe`OI`ho&wnzD?_Y7%Eizn z0dAy8Zm1SK?SNW|RA2qcp#(woW?tDKSQlLfg;&#zO}!oS@(W>lk&To}@R&fE%8+0O z(8GM#a{9e&5*Dwi%XpkYY0IWMy@4DGwTxGlTPwEzqVq76JS5uDCczH-N!Z+5!Ao13 zJ#}C@4v0ldJrbIerrY2$p%TBP5pjjYbuf}a5ID(cd=#k!q=q-<#z*@8E?^yjavW<| zFx)aTD8h0md@RM5u9=NS1GVm&>ALd6Hj=lj@5lNBb}qfmE+#aGQ;`j92n<6dQ=8pl zO!P*gVzyg?x<3?a)fxcqK3*VEWplkc6M_*-Ldp*8x1qcS)98s%b2Y0RaIY+c?~YTe zetnUhy6k?ct0Y-$HoC>ih0N13o%CPXc4`rmsITZwX|Ev->A1hWIj1+{0^ZZ_1sB-f z0ITAB1XwYQhei_E5p~q_SM;MMpJw8T9r0q_me%Uhcuq{$-qQ(snEQ9vuuUS_xZNn__ z5f!JbwFYwtCCWdC$}22VwJ1776VUK zqOF6pc&d(pAg1CtzCCm_fQfe{Ir#V#wCrQo!KpmlzEvp|ZJ*7-m4O%Y?F=Nv$)?nF zk_`kgZNB$e55p&*s>A1MjgNp)+~TW)GRQypdh>y%P=KrAc;gJe1$bNOfw{2vU~59* z%^Rw6z^H2u3JPe_Zvnw&;TbLWj#nXM;r67VZ^edos8wANlPDS7CJsTV4IhD5ZTTUY zBCv5q0IY1c!9E|hlQam(yA$JbR^}>~*}#W+e#PsjS_xSRXs%j6v`h2>WdH1q1(0ku z=SQaY3B}LMJp%$1jg{3M2yt!9mDN>WeK*ceobXuc`zUi9N|m&=BY11t<1LFl z-&yORJiR0zh@?UQ71q1vWxOrftN^&UUEW77Qz9v`ZoH_b#66eD8i;MuyJw5$(a5O6 zMoW0x9=TmfEJ<5tKYkd^>5OhA8|$DgJVA_9iL*p`&jVnf9|VM3P(<9KEjSAE_K$1o z>Y?q3stw7T7Ix<>u{bNM z3rdzmzd}0ksqz|AM}OWGrDw!Q78WqJti!fhv2#$~H5*8{n4TGo^mi#{E*{YHKl~`f z-J_sYIWiRn7tN#Tu$;>M ztxEAyo8`vKd!LWNH-mk114oO-WKy*_@uNqi>o zRY{Q5H{f%vF2*_dB)v&H7#|`Z-w5m+si~`vOy_{w;QCw-SzmWS1BxP99mBcdL%hua zJRiIO6~b`8Ga!O5-+u$aL{SwGMY!SFJMRvZt4Yecx4~#xCw&d$w?5uOfmR zD#y01^*eEt)sR{IsL7u>IYohMuA6a>eulK9H$$n52>9w9Evzax5`pdyY#Vf3N?SBR zVqKE9{wcBoqTY%wf#s3!RuC=<%7By8Xi`&Ez>4%$nqVLME>yXSsIj5HInnR~x2T!u zj@&aQH@yh)oz*NbUcG`Q9gtpimircnSkXOBmx7F5U%GXDY#JlSK0*ZQ^AwU2D1&rg zK{N)1lBuXifxjs6ZW6t#kBY5h7mCPvfO<3?LIYF>OgDNt^mLV683t5Gawu24T;N`v zBQ-qaVuS*OjXby&Q+KY3I$kq~8LAv8E{!dD4j({Yp)J=o7kItm%F zZdVMy{MaB!ENU*T!7_~PG$F-?K2c}I&WRGoG>Zq!h#0!*Tg z=wd(LqvQ;Lg^N$O%x;wgl+y(xHCKHxrA?L92|(O_mbNG!9p6b15M!bu()^N9wD3-D&+iIafP3_VVNO1}5g*mf(xQ z(gRPFoypVAV!S|CvNT6E%>y+us)igSZyf4P66L|{$66u^iL@)@PuxX_j28k25PgZ? zS&;45dQ46wyTKT-NO2pK9^%&MB^IH+L9lut&&CN17#Gyr$4B#!ea8=vh^2B+zToJ7h3FfnwDDE7#b8N~m*$D{kFTS7 zAam^j9VEz54IRK@J0>}vPy^U1`7P!az?SL4(g0{@Z@yfS4B;?1ff#y$wL`))R0qjP z;NLIVU%!8lTh&ZsQ8=Rd+Av*}0ogURL2VBTb-6#N(jT2BI?t)!Y=YsAb(-GH_=#ar zJGywnR4K2nxcDPC_f*KvOmmVX34G&tfvbd1>~e_&YD5{f$&he9Lj;*Y^7mpKM$BrQ=A)S(ar|&Lu=^6phJV&K(6_q!$+5FdCp5M7S>tst zUA@c`%}ckU!u!m$1JLu^VUZO1ls~l!E13+Yu)QLt%@KeMU2+H((HE#{z0s%Lm#1T( zvJSUqt@c*UidVOnnVX{y1U~Kc_7}uDt>-HD&bGH?!GqNwo{sH%3*cxv{ij=SIJcYc zD|l8sn_AmH>e|=uF86?0qw&AtvCcUh^RqFnpvv}wa+}ClvrOA_+Q3c)M9M#tejD4% z=eBf!V@Jee>#BG1KN*kXY#4$$dd-M0sD2PRHe(v8zDwkAha>9~Ij>(i2&9`xRCfiP z%(NolQ3rFMo2){1@R#MnuJ=!+fyg4n$8<1XHr3P3Z=u<;bY{TZ?H`&j*?#d21{%M{ zZYLBJ8@9B?Lp-PLNdWHf**I`|cK7_?COZrcXXHDAC4>DG4A89FV8@ldxqWmY$?wL| zbpv%iU%PA~PC?M%9`6kjXwu?BxE}!K-=BS|)#lp+U1m(h+4ud!K;-3!>tQm}MPmWk`>n`7~)vlWNH(fu`KL6I$Y*PJBP?F6Yg zo5*EP2B8hKYh&!R8=D&3$ItdF$cqcYzR@@RmNGnM?U?!38`wbrYyS&7KlBOAi&ZTe z$udaO0PnV@DZv z3T5}N83S2(FK{T%C8rm2G0X@CwX6cp`mEuZf{50x0abpZiIo}~+)4Buozs8<27Z^h ziw5N1$_<$@7MYOK#>K4b9AuoZkvJMV(Xt6E-mrX_yD1K(q{&xvNQC8Lb7)|mr7^yc zX*2N}^w@XAS{|9EO3qDITtMmd&m~Va*U=Ixywiz>P^OE0p0P~M!~rG~Qi~X)f>#Kg zX};Xs7!u{21f-3!z#4ky4ebwO71d_UL2{ zzf*a(X`MIByGGi*{(??N@%$NO#!N744y>kM5S!P(STvgRL8G+54hRZ_gv;+0%$gEa zc<&@p*97t2lyS3kl@R2eGyeRsM%Imvu0r}Q=)QwLAy?r3oDS6Sc(#Bu3mpNH|1uY^ zgKKcu$%!qrc?-^aKk||&F2zk1zy=776^_2>-i(hNmO^&IZiPRN&|tSA)YKS1#I{Le zwdi^nYBdT>28S-q$Bwy46edHzJZa7SF;Q1u27(*+e7k+Or~Na|L>^&K-7cJU83)F+ z(H1@U{gcYGpqpQYSYuh|^fs?}NtsDXpj>n(0u|kb&;9uB?i~fuH8BK;R>$)__oU0} z18ZCsgQ#*IJCWmyvCs@72j*e`e}WLi-9)?HBVN;!xyK8VasjDs&t&En-fKD&N^JP7 z?7B^ll;5*YA;$ficqi~BS#5cIN)du@nknoz7@YFu2m~8`$SfL%0qffbGl{L^vuiB` z)i=Puhvskwc@Fl#0030)EC|Sd4b3gB4IM3v=v*uZ!+M- z_*_A?EObv{@9R{wOiNs3Z&97-N+`yytOO6pIqjnK>-c9OgeWLN(g zbX46MUEfmrg)?NS0X7*JM^Z(YXW#(Xj7y4s0L1P1$H%xLmZ6*S%@AcBEAKgfDg&t= zjhgxS$@t+LfNWD#GrEvy`vni;6IJu5@&WM`XIOFey%Cgelq6;V`?e{0#7z=t=X;sx zHpsf#eYGNX$vw|dYvU&9Lqy3F2WC*0C!zKpnWJ=~-XvJ0y{#G_@jwzZ6&UbSO5VrB z1@!S14BONhh(Zd?W&9L7v{d@o1)?gpmLsK*#Spwd;50n2rGavAJOE8h!Mi<-Wy{0D(sjc&+os7P*sra z0Tj!ok|o@ln6XtfspjqAq(T_$<`krr%g8iEVux*Yu^ax+Hu}%PZ-0C9YN_vJWc3%( zvfowW2>#Zf|Lfp))it_57*6PZmrDB`P5pmB|AiLi&pJZ@jJ&JRxi&<&xqt!y^u2c~ zjQ^P-8*9s--OiYruJtl2g4aahMi`HS012m=0!&6pk0sWq`VmTWZG{{t?G&R@@T~Z- z(+7)84>83WLrtf&9PG!Kq`OGxyH>6Y--S|cA!sU8^EHEH~D$3Qs|sJS0fj z@|GwHbOJQ!3ewaBEQn;LU~wwSG0KHuF~t1&=X+yDw1Y!DJ*#(SRi7wLxw3*h%4jm0rdF3In)J^k2{=TVwLN0U$Wjg}T)AnRH|+?g zeiWs88n$YO>_VNbC^^ubkr_VTb4MyCYjU0HH)-4ibj(z!mM6q5A!ga#`WH0xjG`_l zv!wtFjrRviM#9o8fUchm1U}6t2nu6ce%7yWWax5f)_VNLc>xE?`o$L_+hF_}dzq z_cugvC2Ndqg;^o%z$pq&A$+k|UF$QlgYAo3C-#i6HIaiowDxvP-3YSWRED&QNt@@P zl2=wN-3&q~3BQqpk|;7bn}p=N={(AkB}gR(7UhyGhSX{dq8&2{#Sle6%Wj!&6y-f> zOc&IqWd86S>E&TXRcCT;{J{*9rGlufjD9SEMBAGZwaw^Q&|OPm-j%ii`sa>AUTO|? z%7z5i1KLc@=1|W!oVUwYPN2RtmoRF}63{vnYznD1v}(uGuOpMZkWv?D^t^X`cQ5gh zZiFEI@=>Aw#wz(i^TOV2rm|%K&&^KYQsVg(p$bU8r;k`QpN@#SSPG*_6>BkrSrE#@ z_RBz<`b_gmhfp(~=wIxui@)`4?Op-UFTJV@NHB?y_<9n!;XU#?soE0S;WOfGz;-|b zH*SBwpq7xf6fiq+1MMEr6^Cm3KtBDwC^BM9Lbli31xChwP^dS7XT&)NQl;830Fdb! z!!N*s3(uEb~K}O+biP|cI)Eq(g8v{WU3Ef=H1{b z&^;4Qz>*pe0l_KyvD#1jKzja`yaX{_&S+k)q4i}PfIMcXUErkjS+&} zmrny9Z#^Bf7ul7EX-*=%x)1CSy>|2aEkL3CP4=pIq@@z-#e$IX!wyNg?HDWw;j?2H zC@c`MZIvLV&=yd|&;P0 zaH!g|-DKIXz;$K``?)b!JOx@N^@69c#j8w{$w6d$`po(ZbrI6Ro@TN#KlI6drIDa1 z*9A;eb>R!xB{ACA6@!5p<&geFnMHauTUDCz698XUbuA>!3YV^ws}eQqf!lZ^4XzUk z{%NttJf4*I;ePw~`XsLSWfgll3SkvVPQP)k3INO?YZNeD-s}WYmQ&?SXQN2S#|wUo z(C=#Z-pi{Ijm4SgyqQ?IhSMeX0;V;$y;XDtARU^S_{f1>3(2{Ohs*9|nFl=m*Qc8u;%>;LkSm&tQT-UH?~) zM`ra;;C~Sr{CjIZV}n1+&#D;yAFTbQZTvdNe;q6QX*$oR{691N-;u*#?f>jee}9Jk lvhV2dzh8#GRQ#v?Ur#i7DNwMVrcmC0^xpS)9e@7y{{T$e)PDc~ literal 0 HcmV?d00001 From 5e22eaaa6de1f2dd2547e59219414015a8c6eb8f Mon Sep 17 00:00:00 2001 From: Tharindu Dharmarathna Date: Thu, 15 Apr 2021 19:16:17 +0530 Subject: [PATCH 2/2] fix test issue --- .../clients/publisher/api/v1/dto/APIRevisionDTO.java | 9 ++++----- .../publisher/api/v1/dto/APIRevisionDeploymentDTO.java | 9 ++++----- .../test/resources/artifacts/AM/git1638/APICreate.json | 5 ----- .../test/resources/artifacts/AM/git1638/APIUpdate.json | 5 ----- .../src/test/resources/oas/v2/additionalProperties.json | 1 - .../tests-backend/src/test/resources/oas/v2/apiData.json | 1 - .../src/test/resources/oas/v2/apiUpdateData.json | 1 - .../src/test/resources/oas/v3/additionalProperties.json | 1 - .../tests-backend/src/test/resources/oas/v3/apiData.json | 1 - .../src/test/resources/oas/v3/apiUpdateData.json | 1 - 10 files changed, 8 insertions(+), 26 deletions(-) diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java index cc82933926..9e5735acd1 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDTO.java @@ -24,7 +24,6 @@ import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; -import java.util.Date; import java.util.List; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIRevisionAPIInfoDTO; import org.wso2.am.integration.clients.publisher.api.v1.dto.APIRevisionDeploymentDTO; @@ -48,7 +47,7 @@ public class APIRevisionDTO { public static final String SERIALIZED_NAME_CREATED_TIME = "createdTime"; @SerializedName(SERIALIZED_NAME_CREATED_TIME) - private Date createdTime; + private String createdTime; public static final String SERIALIZED_NAME_API_INFO = "apiInfo"; @SerializedName(SERIALIZED_NAME_API_INFO) @@ -128,7 +127,7 @@ public void setDescription(String description) { } - public APIRevisionDTO createdTime(Date createdTime) { + public APIRevisionDTO createdTime(String createdTime) { this.createdTime = createdTime; return this; @@ -141,12 +140,12 @@ public APIRevisionDTO createdTime(Date createdTime) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public Date getCreatedTime() { + public String getCreatedTime() { return createdTime; } - public void setCreatedTime(Date createdTime) { + public void setCreatedTime(String createdTime) { this.createdTime = createdTime; } diff --git a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java index d5e3ccf3ec..435b7414e2 100644 --- a/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java +++ b/modules/integration/tests-common/clients/publisher/src/gen/java/org/wso2/am/integration/clients/publisher/api/v1/dto/APIRevisionDeploymentDTO.java @@ -23,7 +23,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; -import java.util.Date; import com.fasterxml.jackson.annotation.JsonCreator; /** * APIRevisionDeploymentDTO @@ -48,7 +47,7 @@ public class APIRevisionDeploymentDTO { public static final String SERIALIZED_NAME_DEPLOYED_TIME = "deployedTime"; @SerializedName(SERIALIZED_NAME_DEPLOYED_TIME) - private Date deployedTime; + private String deployedTime; public APIRevisionDeploymentDTO revisionUuid(String revisionUuid) { @@ -143,7 +142,7 @@ public void setDisplayOnDevportal(Boolean displayOnDevportal) { } - public APIRevisionDeploymentDTO deployedTime(Date deployedTime) { + public APIRevisionDeploymentDTO deployedTime(String deployedTime) { this.deployedTime = deployedTime; return this; @@ -156,12 +155,12 @@ public APIRevisionDeploymentDTO deployedTime(Date deployedTime) { @javax.annotation.Nullable @ApiModelProperty(value = "") - public Date getDeployedTime() { + public String getDeployedTime() { return deployedTime; } - public void setDeployedTime(Date deployedTime) { + public void setDeployedTime(String deployedTime) { this.deployedTime = deployedTime; } diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APICreate.json b/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APICreate.json index 69be4b96d6..e912995857 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APICreate.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APICreate.json @@ -26,11 +26,6 @@ "visibleRoles": [], "visibleTenants": [], "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", - "endpointSecurity": { - "username": "user", - "type": "basic", - "password": "pass" - }, "gatewayEnvironments": "Default", "sequences": [], "subscriptionAvailability": null, diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APIUpdate.json b/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APIUpdate.json index 75dc567900..9b7c0ee8cc 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APIUpdate.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/artifacts/AM/git1638/APIUpdate.json @@ -26,11 +26,6 @@ "visibleRoles": [], "visibleTenants": [], "endpointConfig": "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}", - "endpointSecurity": { - "username": "user", - "type": "basic", - "password": "pass" - }, "gatewayEnvironments": "Default", "sequences": [], "subscriptionAvailability": null, diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/additionalProperties.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/additionalProperties.json index 8040eff66e..d5cdcc8f40 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/additionalProperties.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/additionalProperties.json @@ -24,7 +24,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS", diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiData.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiData.json index c6afbada0d..db960f128d 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiData.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiData.json @@ -24,7 +24,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS", diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiUpdateData.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiUpdateData.json index 1e8391b224..8ef98b0200 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiUpdateData.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v2/apiUpdateData.json @@ -23,7 +23,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS", diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/additionalProperties.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/additionalProperties.json index 342fb7ea50..9c740b3231 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/additionalProperties.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/additionalProperties.json @@ -24,7 +24,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS", diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiData.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiData.json index e652d63baf..1e18c47c70 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiData.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiData.json @@ -24,7 +24,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS", diff --git a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiUpdateData.json b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiUpdateData.json index 8ad06efdd5..221e7c890a 100644 --- a/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiUpdateData.json +++ b/modules/integration/tests-integration/tests-backend/src/test/resources/oas/v3/apiUpdateData.json @@ -23,7 +23,6 @@ "visibility": "PUBLIC", "visibleRoles": [], "visibleTenants": [], - "endpointSecurity": null, "gatewayEnvironments": ["Default"], "mediationPolicies": [], "subscriptionAvailability": "ALL_TENANTS",