From 9b69761752ab57283ad6427cc7823e0c1a52c075 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 12:26:38 +0530 Subject: [PATCH 01/26] added curls to application-management.yaml --- .../apis/restapis/application-management.yaml | 622 +++++++++++++++++- 1 file changed, 592 insertions(+), 30 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/application-management.yaml b/en/asgardeo/docs/apis/restapis/application-management.yaml index 611564424d..08c158a2f1 100644 --- a/en/asgardeo/docs/apis/restapis/application-management.yaml +++ b/en/asgardeo/docs/apis/restapis/application-management.yaml @@ -12,10 +12,6 @@ paths: tags: - Applications operationId: getAllApplications - x-code-samples: - - lang: Shell - source: |- - curl -k -H "Authorization: Bearer " "https://api.asgardeo.io/t//api/server/v1/applications" summary: | List applications description: "This API provides the capability to retrieve the list of applications.\n\n Scope required: ``internal_application_mgt_view``" @@ -61,6 +57,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications?limit=30&offset=0' \ + -H 'accept: application/json' + -H 'Authorization: Bearer {bearer_token>}' /applications/: post: tags: @@ -130,6 +133,144 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/?template={template-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "pickup-dispatch", + "description": "This is the configuration for Pickup-dispatch application.", + "imageUrl": "https://example.com/logo/my-logo.png", + "accessUrl": "https://example.com/login", + "templateId": "b9c5e11e-fc78-484b-9bec-015d247561b8", + "isManagementApp": false, + "claimConfiguration": { + "dialect": "LOCAL", + "claimMappings": [ + { + "applicationClaim": "firstname", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "requestedClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "mandatory": false + } + ], + "subject": { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "includeUserDomain": false, + "includeTenantDomain": false, + "useMappedLocalSubject": false + }, + "role": { + "mappings": [ + { + "localRole": "admin", + "applicationRole": "Administrator" + } + ], + "includeUserDomain": true, + "claim": { + "uri": "http://wso2.org/claims/username" + } + } + }, + "inboundProtocolConfiguration": { + "oidc": { + "clientId": "rMfbPgCi5oWljNhv8c4Pugfuo8Aa", + "clientSecret": "MkHGGiTdAPfTyUKfXLdyOwelMywt", + "grantTypes": [ + "authorization_code", + "password" + ], + "callbackURLs": [ + "regexp=(https://app.example.com/callback1|https://app.example.com/callback2)" + ], + "allowedOrigins": [ + "https://app.example.com" + ], + "publicClient": false, + "pkce": { + "mandatory": false, + "supportPlainTransformAlgorithm": true + }, + "accessToken": { + "type": "JWT", + "userAccessTokenExpiryInSeconds": 3600, + "applicationAccessTokenExpiryInSeconds": 3600, + "bindingType": "cookie", + "revokeTokensWhenIDPSessionTerminated": true, + "validateTokenBinding": true + }, + "refreshToken": { + "expiryInSeconds": 86400, + "renewRefreshToken": true + }, + "idToken": { + "expiryInSeconds": 3600, + "audience": [ + "http://idp.xyz.com", + "http://idp.abc.com" + ], + "encryption": { + "enabled": false, + "algorithm": "RSA-OAEP", + "method": "A128CBC+HS256" + } + }, + "logout": { + "backChannelLogoutUrl": "https://app.example.com/backchannel/callback", + "frontChannelLogoutUrl": "https://app.example.com/frontchannel/callback" + }, + "validateRequestObjectSignature": false, + "scopeValidators": [ + "Role based scope validator" + ] + } + }, + "authenticationSequence": { + "type": "DEFAULT", + "steps": [ + { + "id": 1, + "options": [ + { + "idp": "LOCAL", + "authenticator": "basic" + } + ] + } + ], + "script": "string", + "subjectStepId": 1, + "attributeStepId": 1 + }, + "advancedConfigurations": { + "saas": false, + "discoverableByEndUsers": false, + "certificate": { + "type": "string", + "value": "string" + }, + "skipLoginConsent": false, + "skipLogoutConsent": false, + "useExternalConsentPage": false, + "returnAuthenticatedIdpList": false, + "enableAuthorization": true + } + }' /applications/import: post: tags: @@ -174,6 +315,15 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/import' \ + -H 'accept: */*' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Authorization: Bearer {bearer_token}' \ + -F 'file=@file-name.xml;type=text/xml' put: tags: - Applications @@ -223,7 +373,16 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/applications/{applicationId}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/import' \ + -H 'accept: */*' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Authorization: Bearer {bearer_token>}' \ + -F 'file=@file-name.xml;type=text/xml' + /applications/{applicationId}: get: tags: - Applications @@ -276,7 +435,13 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Applications @@ -323,6 +488,90 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "pickup", + "description": "This is the configuration for Pickup-dispatch application.", + "imageUrl": "https://example.com/logo/my-logo.png", + "accessUrl": "https://example.com/login", + "templateId": "adwefi2429asdfdf94444rraf44", + "claimConfiguration": { + "dialect": "LOCAL", + "claimMappings": [ + { + "applicationClaim": "firstname", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "requestedClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "mandatory": false + } + ], + "subject": { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "includeUserDomain": false, + "includeTenantDomain": false, + "useMappedLocalSubject": false + }, + "role": { + "mappings": [ + { + "localRole": "admin", + "applicationRole": "Administrator" + } + ], + "includeUserDomain": true, + "claim": { + "uri": "http://wso2.org/claims/username" + } + } + }, + "authenticationSequence": { + "type": "DEFAULT", + "steps": [ + { + "id": 1, + "options": [ + { + "idp": "LOCAL", + "authenticator": "basic" + } + ] + } + ], + "script": "string", + "subjectStepId": 1, + "attributeStepId": 1 + }, + "advancedConfigurations": { + "saas": false, + "discoverableByEndUsers": false, + "certificate": { + "type": "string", + "value": "string" + }, + "skipLoginConsent": false, + "skipLogoutConsent": false, + "useExternalConsentPage": false, + "returnAuthenticatedIdpList": false, + "enableAuthorization": true + } + }' delete: tags: - Applications @@ -362,6 +611,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' /applications/{applicationId}/export: get: tags: @@ -407,6 +663,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/export?exportSecrets=false' \ + -H 'accept: application/octet-stream' \ + -H 'Authorization: Bearer {bearer_token}' # /applications/{applicationId}/owner: # put: # tags: @@ -498,6 +761,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/authenticators' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' /applications/resident: get: tags: @@ -535,6 +805,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/resident' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Resident application @@ -582,6 +859,29 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/resident' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "inboundProvisioning": { + "proxyMode": false, + "provisioningUserstoreDomain": "PRIMARY" + }, + "outboundProvisioningIdps": [ + { + "idp": "Google", + "connector": "googleapps", + "blocking": false, + "rules": false, + "jit": false + } + ] + }' requestBody: content: application/json: @@ -635,7 +935,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/applications/{applicationId}/inbound-protocols/saml': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/{applicationId}/inbound-protocols/saml: get: tags: - Inbound Protocols - SAML @@ -679,7 +986,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/saml' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Inbound Protocols - SAML @@ -739,6 +1052,80 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/saml' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "manualConfiguration": { + "issuer": "travelocity_460", + "serviceProviderQualifier": "serviceProviderQualifierValue", + "assertionConsumerUrls": [ + [ + "http://localhost:8080/travelocity_460.com/home.jsp", + "http://localhost:8080/travelocity_460.com/home1.jsp" + ] + ], + "defaultAssertionConsumerUrl": "http://localhost:8080/travelocity_460.com/home1.jsp", + "idpEntityIdAlias": "https://localhost.com", + "singleSignOnProfile": { + "bindings": [ + [ + "HTTP_POST", + "HTTP_REDIRECT" + ] + ], + "enableSignatureValidationForArtifactBinding": false, + "enableIdpInitiatedSingleSignOn": false, + "assertion": { + "nameIdFormat": "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", + "audiences": [ + "https://app.example.com/saml" + ], + "recipients": [ + "https://app.example.com/saml" + ], + "digestAlgorithm": "http://www.w3.org/2000/09/xmldsig#sha1", + "encryption": { + "enabled": false, + "assertionEncryptionAlgorithm": "http://www.w3.org/2001/04/xmlenc#aes256-cbc", + "keyEncryptionAlgorithm": "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p" + } + } + }, + "attributeProfile": { + "enabled": false, + "alwaysIncludeAttributesInResponse": false + }, + "singleLogoutProfile": { + "enabled": true, + "logoutRequestUrl": "https://localhost.com", + "logoutResponseUrl": "https://localhost.com", + "logoutMethod": "BACKCHANNEL", + "idpInitiatedSingleLogout": { + "enabled": false, + "returnToUrls": [ + [ + "https://localhost.com" + ] + ] + } + }, + "requestValidation": { + "enableSignatureValidation": true, + "signatureValidationCertAlias": "string" + }, + "responseSigning": { + "enabled": true, + "signingAlgorithm": "http://www.w3.org/2001/04/xmldsig-more#rsa-ripemd160" + }, + "enableAssertionQueryProfile": false + } + }' requestBody: content: application/json: @@ -786,9 +1173,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - - '/applications/{applicationId}/inbound-protocols/oidc': + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/saml' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/{applicationId}/inbound-protocols/oidc: get: tags: - Inbound Protocols - OAuth / OIDC @@ -832,6 +1224,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/oidc' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Inbound Protocols - OAuth / OIDC @@ -884,6 +1283,65 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{appplication-id}/inbound-protocols/oidc' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}'\ + -d '{ + "clientId": "rMfbPgCi5oWljNhv8c4Pugfuo8Aa", + "clientSecret": "MkHGGiTdAPfTyUKfXLdyOwelMywt", + "grantTypes": [ + "authorization_code", + "password" + ], + "callbackURLs": [ + "regexp=(https://app.example.com/callback1|https://app.example.com/callback2)" + ], + "allowedOrigins": [ + "https://app.example.com" + ], + "publicClient": false, + "pkce": { + "mandatory": false, + "supportPlainTransformAlgorithm": true + }, + "accessToken": { + "type": "JWT", + "userAccessTokenExpiryInSeconds": 3600, + "applicationAccessTokenExpiryInSeconds": 3600, + "bindingType": "cookie", + "revokeTokensWhenIDPSessionTerminated": true, + "validateTokenBinding": true + }, + "refreshToken": { + "expiryInSeconds": 86400, + "renewRefreshToken": true + }, + "idToken": { + "expiryInSeconds": 3600, + "audience": [ + "http://idp.xyz.com", + "http://idp.abc.com" + ], + "encryption": { + "enabled": false, + "algorithm": "RSA-OAEP", + "method": "A128CBC+HS256" + } + }, + "logout": { + "backChannelLogoutUrl": "https://app.example.com/backchannel/callback", + "frontChannelLogoutUrl": "https://app.example.com/frontchannel/callback" + }, + "validateRequestObjectSignature": false, + "scopeValidators": [ + "Role based scope validator" + ] + }' requestBody: content: application/json: @@ -933,9 +1391,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - - '/applications/{applicationId}/inbound-protocols/oidc/regenerate-secret': + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/oidc' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/{applicationId}/inbound-protocols/oidc/regenerate-secret: post: tags: - Inbound Protocols - OAuth / OIDC @@ -979,8 +1442,15 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - '/applications/{applicationId}/inbound-protocols/oidc/revoke': + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/oidc/regenerate-secret' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '' + /applications/{applicationId}/inbound-protocols/oidc/revoke: post: tags: - Inbound Protocols - OAuth / OIDC @@ -1020,8 +1490,15 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - '/applications/{applicationId}/inbound-protocols/passive-sts': + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/application-id/inbound-protocols/oidc/revoke' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '' + /applications/{applicationId}/inbound-protocols/passive-sts: get: tags: - Inbound Protocols - Passive STS @@ -1066,7 +1543,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/passive-sts' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Inbound Protocols - Passive STS @@ -1122,7 +1605,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/passive-sts' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "realm": "string", + "replyTo": "string" + }' requestBody: content: application/json: @@ -1172,7 +1666,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/passive-sts' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' # '/applications/{applicationId}/inbound-protocols/ws-trust': # get: # tags: @@ -1376,6 +1876,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/{inbound-protocol-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Inbound Protocols - Custom @@ -1436,6 +1943,25 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/{inbound-protocol-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "cas", + "configName": "cas", + "properties": [ + { + "key": "app-identifier", + "value": "http://app.wso2.com/employeeApp", + "friendlyName": "Application Identifier" + } + ] + }' requestBody: content: application/json: @@ -1490,8 +2016,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - '/applications/meta/inbound-protocols': + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/{application-id}/inbound-protocols/{inbound-protocol-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/meta/inbound-protocols: get: tags: - Application Metadata @@ -1531,8 +2063,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - '/applications/meta/inbound-protocols/saml': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/meta/inbound-protocols?customOnly=true' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/meta/inbound-protocols/saml: get: tags: - Application Metadata @@ -1571,7 +2109,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/meta/inbound-protocols/saml' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' '/applications/meta/inbound-protocols/oidc': get: tags: @@ -1603,7 +2147,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/meta/inbound-protocols/oidc' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' # '/applications/meta/inbound-protocols/ws-trust': # get: # tags: @@ -1675,8 +2225,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - - '/applications/meta/adaptive-auth-templates': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/meta/inbound-protocols/{inbound-protocol-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /applications/meta/adaptive-auth-templates: get: tags: - Application Metadata @@ -1707,7 +2263,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/applications/meta/adaptive-auth-templates' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: parameters: limitQueryParam: From a62245ea1bc6fb5613932be5d06d1867612ecee6 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 13:26:19 +0530 Subject: [PATCH 02/26] added curls to attribute-management.yaml --- .../apis/restapis/attribute-management.yaml | 215 ++++++++++++++++-- 1 file changed, 200 insertions(+), 15 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/attribute-management.yaml b/en/asgardeo/docs/apis/restapis/attribute-management.yaml index fc5585eca2..1d3f6e3022 100644 --- a/en/asgardeo/docs/apis/restapis/attribute-management.yaml +++ b/en/asgardeo/docs/apis/restapis/attribute-management.yaml @@ -71,7 +71,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/local/claims' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Claims (local) @@ -119,7 +125,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/local/claims' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "claimURI": "http://wso2.org/claims/username", + "description": "Some description about the claim.", + "displayOrder": 10, + "displayName": "Username", + "readOnly": true, + "regEx": "^([a-zA-Z)$", + "required": true, + "supportedByDefault": true, + "attributeMapping": [ + { + "mappedAttribute": "username", + "userstore": "SECONDARY" + } + ], + "properties": [ + { + "key": "string", + "value": "string" + } + ] + }' x-codegen-request-body-name: localClaim /claim-dialects/local/claims/{claim-id}: get: @@ -166,7 +201,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/local/claims/{claim-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Claims (local) @@ -215,7 +256,36 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/local/claims/{claim-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "claimURI": "http://wso2.org/claims/username", + "description": "Some description about the claim.", + "displayOrder": 10, + "displayName": "Username", + "readOnly": true, + "regEx": "^([a-zA-Z)$", + "required": true, + "supportedByDefault": true, + "attributeMapping": [ + { + "mappedAttribute": "username", + "userstore": "SECONDARY" + } + ], + "properties": [ + { + "key": "string", + "value": "string" + } + ] + }' x-codegen-request-body-name: localClaim delete: tags: @@ -252,7 +322,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/local/claims/{claim-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /claim-dialects: get: tags: @@ -307,7 +384,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Claim dialects @@ -354,7 +437,17 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' \ + -H 'Content-Type: application/json' \ + -d '{ + "dialectURI": "urn:ietf:params:scim:schemas:core:2.0:User" + }' x-codegen-request-body-name: claimDialect /claim-dialects/{dialect-id}: get: @@ -401,7 +494,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Claim dialects @@ -444,7 +543,17 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' \ + -H 'Content-Type: application/json' \ + -d '{ + "dialectURI": "urn:ietf:params:scim:schemas:core:2.0:User" + }' x-codegen-request-body-name: claimDialect delete: tags: @@ -481,7 +590,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /claim-dialects/{dialect-id}/claims: get: tags: @@ -548,7 +664,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/export' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + post: tags: - Claims (External) @@ -608,7 +731,18 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/claims' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "claimURI": "urn:ietf:params:scim:schemas:core:2.0:User:userName", + "mappedLocalClaimURI": "http://wso2.org/claims/username" + }' x-codegen-request-body-name: externalClaim /claim-dialects/{dialect-id}/claims/{claim-id}: get: @@ -662,7 +796,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/claims/{claim-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + put: tags: - Claims (External) @@ -717,7 +858,19 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/claims/{claim-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "claimURI": "urn:ietf:params:scim:schemas:core:2.0:User:userName", + "mappedLocalClaimURI": "http://wso2.org/claims/username" + }' + x-codegen-request-body-name: externalClaim delete: tags: @@ -760,7 +913,14 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' - x-wso2-curl: "" + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/claims/{claim-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /claim-dialects/{dialect-id}/export: get: tags: @@ -799,6 +959,14 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/{dialect-id}/export' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /claim-dialects/import: put: tags: @@ -826,6 +994,15 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/import?preserveClaims=false' \ + -H 'accept: */*' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Authorization: Bearer {bearer_token}' + post: tags: - Claim dialects @@ -851,6 +1028,14 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/claim-dialects/import' \ + -H 'accept: */*' \ + -H 'Content-Type: multipart/form-data' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: LocalClaimReq: From c33708934a1344cef34169c963450edfd3bf0894 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 13:36:35 +0530 Subject: [PATCH 03/26] added curls to backup-code.yaml --- .../docs/apis/restapis/backup-code.yaml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/backup-code.yaml b/en/asgardeo/docs/apis/restapis/backup-code.yaml index d8d1063caa..3367993c32 100644 --- a/en/asgardeo/docs/apis/restapis/backup-code.yaml +++ b/en/asgardeo/docs/apis/restapis/backup-code.yaml @@ -37,6 +37,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/backup-codes' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '' tags: - me get: @@ -60,6 +68,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/backup-codes' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' delete: tags: - me @@ -77,6 +92,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/backup-codes' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: From 5553806735729af1c936d9c3b2750423c0c79aa0 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 14:00:01 +0530 Subject: [PATCH 04/26] added curls to consent-management.yaml --- .../apis/restapis/consent-management.yaml | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/consent-management.yaml b/en/asgardeo/docs/apis/restapis/consent-management.yaml index 53913435ba..ec103106cb 100644 --- a/en/asgardeo/docs/apis/restapis/consent-management.yaml +++ b/en/asgardeo/docs/apis/restapis/consent-management.yaml @@ -76,6 +76,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents?limit=&offset=&piiPrincipalId=&spTenantDomain=&service=*&state=" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -132,6 +139,53 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "services": [ + { + "service": "string", + "serviceDisplayName": "string", + "serviceDescription": "string", + "tenantDomain": "string", + "purposes": [ + { + "purposeId": 0, + "purposeCategoryId": [ + 0 + ], + "consentType": "string", + "piiCategory": [ + { + "piiCategoryId": 0, + "validity": "string" + } + ], + "primaryPurpose": true, + "termination": "string", + "thirdPartyDisclosure": true, + "thirdPartyName": "string" + } + ] + } + ], + "collectionMethod": "string", + "jurisdiction": "string", + "language": "string", + "policyURL": "string", + "properties": [ + { + "key": "string", + "value": "string" + } + ] + }' x-wso2-request: | curl -k -X POST "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents" -H "Authorization: Basic " -H "accept: application/json" -H "Content-Type: application/json" -d "{\"services\": [ { \"service\": \"\", \"tenantDomain\": \"\", \"purposes\": [ { \"purposeId\": , \"purposeCategoryId\": [ ], \"consentType\": \"\", \"piiCategory\": [ { \"piiCategoryId\": , \"validity\": \"days:\" }, { \"piiCategoryId\": , \"validity\": \"days:\" } ], \"primaryPurpose\": true, \"termination\": \"days:\", \"thirdPartyDisclosure\": false, \"thirdPartyName\": \"\" } ] } ], \"collectionMethod\": \"\", \"jurisdiction\": \"\", \"language\": \"\", \"policyURL\": \"", \"properties\": [ { \"key\": \"\", \"value\": \"v1\" } ]}" x-wso2-curl: | @@ -185,6 +239,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/receipts/{receipt-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/receipts/" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -233,6 +294,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/receipts/{receipt-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X DELETE "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/receipts/" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -299,6 +367,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purposes' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purposes?group=&groupType=limit=&offset=" -H "Authorization: Basic " -H "accept: application/json" -H "Content-Type: application/json" x-wso2-curl: | @@ -408,6 +483,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purposes/{purpose-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purposes/" -H "Authorization: Basic " -H "accept: application/json" -H "Content-Type: application/json" x-wso2-curl: | @@ -512,6 +594,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purpose-categories' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purpose-categories?limit=&offset=" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -621,6 +710,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purpose-categories/{purpose-catergory-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/purpose-categories/" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -725,6 +821,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/pii-categories' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/pii-categories?limit=&offset=" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | @@ -834,6 +937,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/pii-categories/{pii-catergory-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -k -X GET "https://api.asgardeo.io/t/{organization-name}/api/identity/consent-mgt/v1.0/consents/pii-categories/" -H "Authorization: Basic " -H "accept: application/json" x-wso2-curl: | From 84323c828f23899203f3f64fc2fa3aa9222f8f65 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 15:28:16 +0530 Subject: [PATCH 05/26] added curls to email-template.yaml --- .../docs/apis/restapis/email-template.yaml | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/email-template.yaml b/en/asgardeo/docs/apis/restapis/email-template.yaml index 8f3c9050ab..344fe21b78 100644 --- a/en/asgardeo/docs/apis/restapis/email-template.yaml +++ b/en/asgardeo/docs/apis/restapis/email-template.yaml @@ -47,6 +47,13 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Email template types @@ -86,6 +93,26 @@ paths: $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "displayName": "Account Confirmation", + "templates": [ + { + "contentType": "text/html", + "subject": "WSO2 - Account Confirmation", + "body": "HTML Body", + "footer": "WSO2 Asgardeo Team", + "id": "en_US" + } + ] + }' /email/template-types/{template-type-id}: delete: tags: @@ -113,6 +140,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' get: tags: - Email templates @@ -146,6 +180,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Email templates @@ -185,6 +226,21 @@ paths: $ref: '#/components/responses/Conflict' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "contentType": "text/html", + "subject": "WSO2 - Account Confirmation", + "body": "HTML Body", + "footer": "WSO2 Asgardeo Team", + "id": "en_US" + }' put: tags: - Email templates @@ -218,6 +274,23 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "contentType": "text/html", + "subject": "WSO2 - Account Confirmation", + "body": "HTML Body", + "footer": "WSO2 Asgardeo Team", + "id": "en_US" + } + ]' '/email/template-types/{template-type-id}/templates': get: tags: @@ -253,6 +326,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}/templates' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' '/email/template-types/{template-type-id}/templates/{template-id}': get: tags: @@ -288,6 +368,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}/templates/{template-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Email templates @@ -320,6 +407,21 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}/templates/{template-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "contentType": "text/html", + "subject": "WSO2 - Account Confirmation", + "body": "HTML Body", + "footer": "WSO2 Asgardeo Team", + "id": "en_US" + }' delete: tags: - Email templates @@ -346,6 +448,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/email/template-types/{email-template-type-id}/templates/{template-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' servers: - url: 'https://api.asgardeo.io/t/{org-name}/api/server/v1' variables: From 53d8e9e6cf031ea12860680f09e27bbdfcc198b9 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 16:47:58 +0530 Subject: [PATCH 06/26] added curls to event-configuration.yaml --- .../apis/restapis/event-configuration.yaml | 50 ++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/en/asgardeo/docs/apis/restapis/event-configuration.yaml b/en/asgardeo/docs/apis/restapis/event-configuration.yaml index 6a208a01d6..e0d10781ef 100644 --- a/en/asgardeo/docs/apis/restapis/event-configuration.yaml +++ b/en/asgardeo/docs/apis/restapis/event-configuration.yaml @@ -39,6 +39,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/%7Borganization-name%7D/api/event-configurations/v1/events' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Events Configurations @@ -78,7 +85,24 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' - '/events/{eventName}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/%7Borganization-name%7D/api/event-configurations/v1/events' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "eventName": "registrations.addUser", + "eventSchema": "urn:ietf:params:registrations:addUser", + "displayName": "Add user event", + "category": "Registration events", + "publish": true + } + ]' + /events/{eventName}: get: tags: - Event Configurations @@ -117,6 +141,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/%7Borganization-name%7D/api/event-configurations/v1/events/{event-name}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Event Configurations @@ -163,6 +194,23 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/%7Borganization-name%7D/api/event-configurations/v1/events/{event-name}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "publish": true, + "properties": [ + { + "key": "attribute1", + "value": "value1" + } + ] + }' components: schemas: Event: From 9f8d34006239d5a13a058d997aa4b98d8a1ffdbd Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 16:49:20 +0530 Subject: [PATCH 07/26] added curls to export-admin-info.yaml --- en/asgardeo/docs/apis/restapis/export-admin-info.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/export-admin-info.yaml b/en/asgardeo/docs/apis/restapis/export-admin-info.yaml index 87e2e106af..27ecb7062f 100644 --- a/en/asgardeo/docs/apis/restapis/export-admin-info.yaml +++ b/en/asgardeo/docs/apis/restapis/export-admin-info.yaml @@ -40,6 +40,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/api/identity/user/v1.0/me' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: From 8b6c2e9fbfbce3afac4c88dc6651116557ffa142 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 16:51:44 +0530 Subject: [PATCH 08/26] added curls to export-user-info.yaml --- en/asgardeo/docs/apis/restapis/export-user-info.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/export-user-info.yaml b/en/asgardeo/docs/apis/restapis/export-user-info.yaml index d31aadac22..a5ea3bb9d9 100644 --- a/en/asgardeo/docs/apis/restapis/export-user-info.yaml +++ b/en/asgardeo/docs/apis/restapis/export-user-info.yaml @@ -40,6 +40,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/api/identity/user/v1.0/me' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: From ac43d8f9076d0a2cc55031b2508bd37dfad65bc8 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 16:55:42 +0530 Subject: [PATCH 09/26] added curls to extend-sessions.yaml --- en/asgardeo/docs/apis/restapis/extend-sessions.yaml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/extend-sessions.yaml b/en/asgardeo/docs/apis/restapis/extend-sessions.yaml index 88ffccc977..b7d7ee18f9 100644 --- a/en/asgardeo/docs/apis/restapis/extend-sessions.yaml +++ b/en/asgardeo/docs/apis/restapis/extend-sessions.yaml @@ -27,14 +27,11 @@ paths: required: true schema: type: string - example: curl --location --request GET 'https://api.asgardeo.io/t/{organization-name}/identity/extend-session?idpSessionKey=' - name: commonAuthId in: cookie description: Use the commonAuthId value as the session identifier in the cookie section of the request. This value can be obtained from the session cookie generated for the session. schema: type: string - example: | - curl --location --request GET 'https://api.asgardeo.io/t/{organization-name}/identity/extend-session' \ --header 'Cookie: commonAuthId=' responses: '200': description: Successful response. @@ -55,6 +52,14 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorServer' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/%7Borganization-name%7D/identity/extend-session?idpSessionKey={isk}' \ + -H 'accept: */*' \ + -H 'Cookie: commonAuthId={common-auth-id}' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: ErrorServer: From 96bbfb0ceb0b031cf565e4f7ca44a793ac2b9642 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 20:29:36 +0530 Subject: [PATCH 10/26] added curls to identity-governance.yaml --- .../apis/restapis/identity-governance.yaml | 73 ++++++++++++++++++- 1 file changed, 70 insertions(+), 3 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/identity-governance.yaml b/en/asgardeo/docs/apis/restapis/identity-governance.yaml index ff52160db9..ffb3fd9260 100644 --- a/en/asgardeo/docs/apis/restapis/identity-governance.yaml +++ b/en/asgardeo/docs/apis/restapis/identity-governance.yaml @@ -37,7 +37,14 @@ paths: $ref: '#/components/responses/ServerError' '501': $ref: '#/components/responses/NotImplemented' - '/identity-governance/{category-id}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-governance/{category-id}: get: tags: - Management @@ -59,7 +66,14 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' - '/identity-governance/{category-id}/connectors': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/{catergory-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-governance/{category-id}/connectors: get: tags: - Management @@ -83,6 +97,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/{catergory-id}/connectors' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Management @@ -102,6 +123,28 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/{catergory-id}/connectors' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "operation": "UPDATE", + "connectors": [ + { + "id": "c3VzcGVuc2lvbi5ub3RpZmljYXRpb24", + "properties": [ + { + "name": "suspension.notification.enable", + "value": "false" + } + ] + } + ] + }' requestBody: content: application/json: @@ -109,7 +152,7 @@ paths: $ref: '#/components/schemas/MultipleConnectorsPatchReq' description: Governance connectors and properties to update required: true - '/identity-governance/{category-id}/connectors/{connector-id}': + /identity-governance/{category-id}/connectors/{connector-id}: get: tags: - Management @@ -132,6 +175,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/{catergory-id}/connectors/{connector-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Management @@ -152,6 +202,23 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-governance/{catergory-id}/connectors/{connector-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "operation": "UPDATE", + "properties": [ + { + "name": "suspension.notification.enable", + "value": "false" + } + ] + }' requestBody: content: application/json: From 9f18f73f0d26949a0f82e066924c83c5ac94c531 Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 20:31:51 +0530 Subject: [PATCH 11/26] added curls to idle-account-identification.yaml --- .../docs/apis/restapis/idle-account-identification.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/idle-account-identification.yaml b/en/asgardeo/docs/apis/restapis/idle-account-identification.yaml index acd4cebf8b..c9ef159bbb 100644 --- a/en/asgardeo/docs/apis/restapis/idle-account-identification.yaml +++ b/en/asgardeo/docs/apis/restapis/idle-account-identification.yaml @@ -40,6 +40,13 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/idle-account-identification/v1/inactive-users?inactiveAfter=2023-01-31&excludeBefore=2023-01-01' \ + -H 'accept: application/json' + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: From a45f2f6e7f1f9095e11383f9f0513952e25cb56b Mon Sep 17 00:00:00 2001 From: wso2 Date: Thu, 9 Nov 2023 21:18:30 +0530 Subject: [PATCH 12/26] added curls to idp.yaml --- en/asgardeo/docs/apis/restapis/idp.yaml | 482 +++++++++++++++++++++++- 1 file changed, 475 insertions(+), 7 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/idp.yaml b/en/asgardeo/docs/apis/restapis/idp.yaml index 4fd7acb8b5..f301da51fa 100644 --- a/en/asgardeo/docs/apis/restapis/idp.yaml +++ b/en/asgardeo/docs/apis/restapis/idp.yaml @@ -59,6 +59,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Identity Providers @@ -112,6 +119,109 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "google", + "description": "IdP for Google Federation", + "image": "google-logo-url", + "isPrimary": false, + "isFederationHub": false, + "homeRealmIdentifier": "localhost", + "certificate": { + "certificates": [ + "string" + ], + "jwksUri": "https://api.asgardeo.io/t/{org-name}/oauth2/jwks" + }, + "alias": "https://api.asgardeo.io/t/{org-name}/oauth2/token", + "claims": { + "userIdClaim": { + "uri": "http://wso2.org/claims/username" + }, + "roleClaim": { + "uri": "http://wso2.org/claims/username" + }, + "mappings": [ + { + "idpClaim": "country", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "provisioningClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "defaultValue": "sathya" + } + ] + }, + "roles": { + "mappings": [ + { + "idpRole": "google-manager", + "localRole": "manager" + } + ], + "outboundProvisioningRoles": [ + "manager", + "hr-admin" + ] + }, + "federatedAuthenticators": { + "defaultAuthenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "authenticators": [ + { + "authenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "isEnabled": true, + "isDefault": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + }, + "provisioning": { + "jit": { + "isEnabled": true, + "scheme": "PROVISION_SILENTLY", + "userstore": "PRIMARY", + "associateLocalUser": true, + "attributeSyncMethod": "OVERRIDE_ALL" + }, + "outboundConnectors": { + "defaultConnectorId": "U0NJTQ", + "connectors": [ + { + "connectorId": "U0NJTQ", + "isEnabled": true, + "isDefault": false, + "blockingEnabled": false, + "rulesEnabled": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + } + } + }' + requestBody: content: application/json: @@ -161,7 +271,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/identity-providers/meta/federated-authenticators/{federated-authenticator-id}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/meta/federated-authenticators' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-providers/meta/federated-authenticators/{federated-authenticator-id}: get: tags: - Metadata @@ -205,13 +322,20 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/meta/federated-authenticators/{federated-authenticator-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' /identity-providers/meta/outbound-provisioning-connectors: get: tags: - Metadata summary: > List supported outbound provisioning connectors of IdPs - description: "This API provides the list of supported federated authenticators for an identity provider (IdP) in the Asgardeo. \n\n Scope required: `nternal_idp_view`" + description: "This API provides the list of supported federated authenticators for an identity provider (IdP) in the Asgardeo. \n\n Scope required: `internal_idp_view`" operationId: getMetaOutboundConnectors responses: '200': @@ -244,7 +368,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/identity-providers/meta/outbound-provisioning-connectors/{outbound-provisioning-connector-id}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/meta/outbound-provisioning-connectors' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-providers/meta/outbound-provisioning-connectors/{outbound-provisioning-connector-id}: get: tags: - Metadata @@ -288,7 +419,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/identity-providers/{identity-provider-id}': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/meta/outbound-provisioning-connectors/{outbound-provisioning-connector-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-providers/{identity-provider-id}: get: tags: - Identity Providers @@ -344,6 +482,13 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Identity Providers @@ -392,6 +537,21 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "operation": "REPLACE", + "path": "/homeRealmIdentifier", + "value": "google" + } + ]' requestBody: content: application/json: @@ -438,7 +598,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/identity-providers/{identity-provider-id}/federated-authenticators': + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}?force=false' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-providers/{identity-provider-id}/federated-authenticators: get: tags: - Federated Authenticators @@ -482,6 +649,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/federated-authenticators' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Federated Authenticators @@ -525,6 +699,30 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/federated-authenticators' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "defaultAuthenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "authenticators": [ + { + "authenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "isEnabled": true, + "isDefault": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + }' requestBody: content: application/json: @@ -582,6 +780,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/federated-authenticators/{federated-authenticator-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Federated Authenticators @@ -636,6 +841,24 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/federated-authenticators/{federated-authenticator-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "isEnabled": true, + "isDefault": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + }' requestBody: content: application/json: @@ -687,7 +910,14 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - '/identity-providers/{identity-provider-id}/provisioning/outbound-connectors': + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' + /identity-providers/{identity-provider-id}/provisioning/outbound-connectors: get: tags: - Provisioning @@ -731,6 +961,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning/outbound-connectors' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Provisioning @@ -774,6 +1011,32 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning/outbound-connectors' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "defaultConnectorId": "U0NJTQ", + "connectors": [ + { + "connectorId": "U0NJTQ", + "isEnabled": true, + "isDefault": false, + "blockingEnabled": false, + "rulesEnabled": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + }' requestBody: content: application/json: @@ -831,6 +1094,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning/outbound-connectors/{outbound-provisioning-connector-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Provisioning @@ -885,6 +1155,26 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/identity-provider-id/provisioning/outbound-connectors/outbound-provisioning-connector-id' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "isEnabled": true, + "isDefault": false, + "blockingEnabled": false, + "rulesEnabled": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + }' requestBody: content: application/json: @@ -936,6 +1226,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/claims' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Claims @@ -984,6 +1281,38 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/claims' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "userIdClaim": { + "uri": "http://wso2.org/claims/username" + }, + "roleClaim": { + "uri": "http://wso2.org/claims/username" + }, + "mappings": [ + { + "idpClaim": "country", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "provisioningClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "defaultValue": "sathya" + } + ] + }' requestBody: content: application/json: @@ -1035,6 +1364,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/identity-provider-id/roles' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Roles @@ -1083,6 +1419,26 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/roles' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "mappings": [ + { + "idpRole": "google-manager", + "localRole": "manager" + } + ], + "outboundProvisioningRoles": [ + "manager", + "hr-admin" + ] + }' requestBody: content: application/json: @@ -1090,7 +1446,7 @@ paths: $ref: '#/components/schemas/Roles' description: This represents the role config to be updated. required: true - '/identity-providers/{identity-provider-id}/provisioning/jit': + /identity-providers/{identity-provider-id}/provisioning/jit: get: tags: - Provisioning @@ -1134,6 +1490,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning/jit' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Provisioning @@ -1182,6 +1545,22 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/provisioning/jit' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "isEnabled": true, + "scheme": "PROVISION_SILENTLY", + "userstore": "PRIMARY", + "associateLocalUser": true, + "attributeSyncMethod": "OVERRIDE_ALL" + }' + requestBody: content: application/json: @@ -1235,6 +1614,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/identity-providers/{identity-provider-id}/connected-apps' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' '/trusted-token-issuers': get: tags: @@ -1275,6 +1661,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/trusted-token-issuers' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Trusted Token Issuers @@ -1328,6 +1721,52 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/trusted-token-issuers' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "google", + "description": "Trusted Token Issuer", + "image": "issuer-logo-url", + "templateId": "8ea23303-49c0-4253-b81f-82c0fe6fb4a0", + "certificate": { + "certificates": [ + "string" + ], + "jwksUri": "https://api.asgardeo.io/t/{org-name}/oauth2/jwks" + }, + "alias": "https://api.asgardeo.io/t/{org-name}/oauth2/token", + "issuer": "https://www.issuer.com", + "claims": { + "userIdClaim": { + "uri": "http://wso2.org/claims/username" + }, + "roleClaim": { + "uri": "http://wso2.org/claims/username" + }, + "mappings": [ + { + "idpClaim": "country", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "provisioningClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "defaultValue": "sathya" + } + ] + } + }' requestBody: content: application/json: @@ -1392,6 +1831,13 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/trusted-token-issuers/{trusted-token-issuer-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Trusted Token Issuers @@ -1440,6 +1886,21 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/trusted-token-issuers/{trusted-token-issuer-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "operation": "REPLACE", + "path": "/homeRealmIdentifier", + "value": "google" + } + ]' requestBody: content: application/json: @@ -1486,6 +1947,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/trusted-token-issuers/t{rusted-token-issuer-id}?force=false' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' components: parameters: limitQueryParam: From 3d273e6e09a4573a1a36fad3b1a2a25fd0d304d7 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 09:30:20 +0530 Subject: [PATCH 13/26] added curls to oauth-dcr.yaml --- en/asgardeo/docs/apis/restapis/oauth-dcr.yaml | 133 +++++++++++------- 1 file changed, 83 insertions(+), 50 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/oauth-dcr.yaml b/en/asgardeo/docs/apis/restapis/oauth-dcr.yaml index 226d2ba629..abb46cd8d7 100644 --- a/en/asgardeo/docs/apis/restapis/oauth-dcr.yaml +++ b/en/asgardeo/docs/apis/restapis/oauth-dcr.yaml @@ -43,16 +43,13 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - x-wso2-request: | - curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '{}' "https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register?client_name=application_owner_application_1" - x-wso2-response: | - "HTTP/1.1 200 OK" - { "client_id": "s6BhdRkqt3", - "client_secret":"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", - "client_secret_expires_at": 1577858400, - "redirect_uris":["https://client.example.org/callback"], - "client_name":"application_owner_application_1", - "grant_types": ["password"]} + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register?client_name={client-app-name}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - OAuth2 DCR @@ -95,21 +92,46 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - x-wso2-request: | - curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H - "Content-Type: application/json" -d '{ - "redirect_uris":[""], - "client_name": "application_1", - "grant_types": ["password"] }' - "https://api.asgardeo.io/t/{org-name}/api/identity/oauth2/dcr/v1.1/register" - x-wso2-response: | - "HTTP/1.1 201 Created" - { "client_id": "s6BhdRkqt3", - "client_secret":"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", - "client_secret_expires_at": 1577858400, - "redirect_uris":[""], - "grant_types": ["password"], - "client_name":"application_1" } + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "redirect_uris": [ + "string" + ], + "client_name": "string", + "client_id": "string", + "client_secret": "string", + "grant_types": [ + "authorization_code", + "password" + ], + "application_type": "string", + "jwks_uri": "string", + "url": "string", + "ext_param_client_id": "string", + "ext_param_client_secret": "string", + "contacts": [ + "string" + ], + "post_logout_redirect_uris": [ + "string" + ], + "request_uris": [ + "string" + ], + "response_types": [ + "string" + ], + "ext_param_sp_template": "string", + "backchannel_logout_uri": "string", + "backchannel_logout_session_required": true + }' x-codegen-request-body-name: registrationRequest /register/{client_id}: get: @@ -145,16 +167,13 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - x-wso2-request: | - curl -X GET -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '{}' "https://api.asgardeo.io/t/{org-name}/api/identity/oauth2/dcr/v1.1/register/s6BhdRkqt3" - x-wso2-response: | - "HTTP/1.1 200 OK" - { "client_id": "s6BhdRkqt3", - "client_secret":"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", - "client_secret_expires_at": 1577858400, - "redirect_uris":["https://client.example.org/callback"], - "grant_types": ["password"], - "client_name":"application_owner_application_1" } + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register/{client-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - OAuth2 DCR @@ -201,21 +220,28 @@ paths: application/json: schema: $ref: '#/components/schemas/error' - x-wso2-request: | - curl -X PUT -H "Authorization: Basic YWRtaW46YWRtaW4=" -H - "Content-Type: application/json" -d '{ - "redirect_uris":["https://client.example.org/callback"], - "client_name": "application_1", - "grant_types": ["password"] }' - "https://api.asgardeo.io/t/{org-name}/api/identity/oauth2/dcr/v1.1/register" - x-wso2-response: | - "HTTP/1.1 200 OK" - { "client_id": "s6BhdRkqt3", - "client_secret":"ZJYCqe3GGRvdrudKyZS0XhGv_Z45DuKhCUk0gBR1vZk", - "client_secret_expires_at": 1577858400, - "redirect_uris":["https://client.example.org/callback"], - "grant_types": ["password"], - "client_name":"application_owner_application_1" } + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register/{client_id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "redirect_uris": [ + "string" + ], + "client_name": "client_application", + "client_id": "string", + "client_secret": "string", + "grant_types": [ + "authorization_code", + "password" + ], + "backchannel_logout_uri": "string", + "backchannel_logout_session_required": true + }' x-codegen-request-body-name: updateRequest delete: tags: @@ -247,6 +273,13 @@ paths: application/json: schema: $ref: '#/components/schemas/error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/identity/oauth2/dcr/v1.1/register/{client_id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' x-wso2-request: | curl -X DELETE -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" -d '{}' "https://api.asgardeo.io/t/{org-name}/api/identity/oauth2/dcr/v1.1/register/s6BhdRkqt3" x-wso2-response: | From c5c4b65ab7cc30947c486b4fd27962833a130e63 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 09:58:57 +0530 Subject: [PATCH 14/26] added curls to onboard-admins-self-service.yaml --- .../restapis/onboard-admins-self-service.yaml | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/onboard-admins-self-service.yaml b/en/asgardeo/docs/apis/restapis/onboard-admins-self-service.yaml index aef8aaadbf..fb22001df8 100644 --- a/en/asgardeo/docs/apis/restapis/onboard-admins-self-service.yaml +++ b/en/asgardeo/docs/apis/restapis/onboard-admins-self-service.yaml @@ -35,6 +35,23 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{organization-domain}/api/server/v1/self-service/preferences' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "operation": "UPDATE", + "properties": [ + { + "name": "auto.login.enable", + "value": "false" + } + ] + }' tags: - SelfService get: @@ -59,6 +76,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-domain}/api/server/v1/self-service/preferences' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' tags: - SelfService From d3b2f3371dadb4c538e9efa72761c1e6d1877340 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 10:06:39 +0530 Subject: [PATCH 15/26] added curls to org-application-management.yaml --- .../restapis/org-application-management.yaml | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/org-application-management.yaml b/en/asgardeo/docs/apis/restapis/org-application-management.yaml index 3e6a60837d..5ffd67445d 100644 --- a/en/asgardeo/docs/apis/restapis/org-application-management.yaml +++ b/en/asgardeo/docs/apis/restapis/org-application-management.yaml @@ -60,6 +60,13 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/applications/{application-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Applications @@ -106,6 +113,93 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/applications/{application-id}' \ + -H 'accept: */*' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "pickup", + "description": "This is the configuration for Pickup-dispatch application.", + "imageUrl": "https://example.com/logo/my-logo.png", + "accessUrl": "https://example.com/login", + "templateId": "adwefi2429asdfdf94444rraf44", + "claimConfiguration": { + "dialect": "LOCAL", + "claimMappings": [ + { + "applicationClaim": "firstname", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "requestedClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "mandatory": false + } + ], + "subject": { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "includeUserDomain": false, + "includeTenantDomain": false, + "useMappedLocalSubject": false + }, + "role": { + "mappings": [ + { + "localRole": "admin", + "applicationRole": "Administrator" + } + ], + "includeUserDomain": true, + "claim": { + "uri": "http://wso2.org/claims/username" + } + } + }, + "authenticationSequence": { + "type": "DEFAULT", + "steps": [ + { + "id": 1, + "options": [ + { + "idp": "LOCAL", + "authenticator": "basic" + } + ] + } + ], + "requestPathAuthenticators": [ + "string" + ], + "script": "string", + "subjectStepId": 1, + "attributeStepId": 1 + }, + "advancedConfigurations": { + "saas": false, + "discoverableByEndUsers": false, + "certificate": { + "type": "string", + "value": "string" + }, + "skipLoginConsent": false, + "skipLogoutConsent": false, + "useExternalConsentPage": false, + "returnAuthenticatedIdpList": false, + "enableAuthorization": true + } + }' components: parameters: limitQueryParam: From 2eb9c5b8228b5316ac2f467c51e233aaa814542c Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 10:16:44 +0530 Subject: [PATCH 16/26] added curls to org-idle-account-identification.yaml and added it to navigation --- .../apis/restapis/org-idle-account-identification.yaml | 7 +++++++ en/asgardeo/mkdocs.yml | 1 + 2 files changed, 8 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/org-idle-account-identification.yaml b/en/asgardeo/docs/apis/restapis/org-idle-account-identification.yaml index 0d2efca05e..ee2a7d04e8 100644 --- a/en/asgardeo/docs/apis/restapis/org-idle-account-identification.yaml +++ b/en/asgardeo/docs/apis/restapis/org-idle-account-identification.yaml @@ -41,6 +41,13 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{sub-organization-id}/api/idle-account-identification/v1/inactive-users?inactiveAfter=2023-01-31&excludeBefore=2023-01-01' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: diff --git a/en/asgardeo/mkdocs.yml b/en/asgardeo/mkdocs.yml index 172a6f31ce..e76e8cf0ae 100644 --- a/en/asgardeo/mkdocs.yml +++ b/en/asgardeo/mkdocs.yml @@ -284,6 +284,7 @@ nav: - Identity providers API: apis/organization-management/org-idp.md - Organization management API: apis/organization-management/org-management.md - Organization role management API: apis/organization-management/organization-role-management.md + - Idle account identification API: apis/organization-management/org-idle-account-identification.md - Idle account identification API: apis/idle-account-identification.md - References: - References - Overview: references/index.md From 2a22320c640a15a5d6b530c036fd331595d6a498 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 10:33:39 +0530 Subject: [PATCH 17/26] added curls to org-idp.yaml --- en/asgardeo/docs/apis/restapis/org-idp.yaml | 138 ++++++++++++++++++++ 1 file changed, 138 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/org-idp.yaml b/en/asgardeo/docs/apis/restapis/org-idp.yaml index cde1d61f52..5db4b70a09 100644 --- a/en/asgardeo/docs/apis/restapis/org-idp.yaml +++ b/en/asgardeo/docs/apis/restapis/org-idp.yaml @@ -57,6 +57,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/identity-providers' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Identity Providers @@ -110,6 +117,108 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/identity-providers' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "google", + "description": "IdP for Google Federation", + "image": "google-logo-url", + "isPrimary": false, + "isFederationHub": false, + "homeRealmIdentifier": "localhost", + "certificate": { + "certificates": [ + "string" + ], + "jwksUri": "https://api.asgardeo.io/t/{org-name}/oauth2/jwks" + }, + "alias": "https://api.asgardeo.io/t/{org-name}/oauth2/token", + "claims": { + "userIdClaim": { + "uri": "http://wso2.org/claims/username" + }, + "roleClaim": { + "uri": "http://wso2.org/claims/username" + }, + "mappings": [ + { + "idpClaim": "country", + "localClaim": { + "uri": "http://wso2.org/claims/username" + } + } + ], + "provisioningClaims": [ + { + "claim": { + "uri": "http://wso2.org/claims/username" + }, + "defaultValue": "sathya" + } + ] + }, + "roles": { + "mappings": [ + { + "idpRole": "google-manager", + "localRole": "manager" + } + ], + "outboundProvisioningRoles": [ + "manager", + "hr-admin" + ] + }, + "federatedAuthenticators": { + "defaultAuthenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "authenticators": [ + { + "authenticatorId": "U0FNTDJBdXRoZW50aWNhdG9y", + "isEnabled": true, + "isDefault": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + }, + "provisioning": { + "jit": { + "isEnabled": true, + "scheme": "PROVISION_SILENTLY", + "userstore": "PRIMARY", + "associateLocalUser": true, + "attributeSyncMethod": "OVERRIDE_ALL" + }, + "outboundConnectors": { + "defaultConnectorId": "U0NJTQ", + "connectors": [ + { + "connectorId": "U0NJTQ", + "isEnabled": true, + "isDefault": false, + "blockingEnabled": false, + "rulesEnabled": false, + "properties": [ + { + "key": "somePropertyKey", + "value": "somePropertyValue" + } + ] + } + ] + } + } + }' requestBody: content: application/json: @@ -176,6 +285,13 @@ paths: application/xml: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/identity-providers/{identity-provider-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Identity Providers @@ -224,6 +340,21 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/identity-providers/{identity-provider-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "operation": "REPLACE", + "path": "/homeRealmIdentifier", + "value": "google" + } + ]' requestBody: content: application/json: @@ -270,6 +401,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/identity-providers/{identity-provider-id}?force=false' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' servers: - url: 'https://api.asgardeo.io/o/{suborganization-id}/api/server/v1' variables: From 5b233d30fe12b1f2aa802f3ad45513d3e436f5cc Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 10:57:56 +0530 Subject: [PATCH 18/26] added curls to org-management.yaml --- .../docs/apis/restapis/org-management.yaml | 77 ++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/en/asgardeo/docs/apis/restapis/org-management.yaml b/en/asgardeo/docs/apis/restapis/org-management.yaml index 2b9238f841..bc9562e006 100644 --- a/en/asgardeo/docs/apis/restapis/org-management.yaml +++ b/en/asgardeo/docs/apis/restapis/org-management.yaml @@ -6,7 +6,7 @@ info: update, retrieve and delete organizations.

Important:
- You need a paid Asgardeo subscription to create hierarchical organizations. If you don’t already have one, + You need a paid Asgardeo subscription to create hierarchical organizations. If you don't already have one, view the available [subscription plans](https://wso2.com/asgardeo/pricing/) and contact the Asgardeo sales team. ' servers: @@ -54,6 +54,26 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "ABC Builders", + "description": "Building constructions", + "type": "TENANT", + "parentId": "b4526d91-a8bf-43d2-8b14-c548cf73065b", + "attributes": [ + { + "key": "Country", + "value": "Sri Lanka" + } + ] + }' get: description: "This API is used to search and retrieve organizations created for this organization.
\n\n Scope required: `internal_organization_view`" summary: @@ -82,6 +102,13 @@ paths: $ref: '#/components/responses/ServerError' '501': $ref: '#/components/responses/NotImplemented' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/?recursive=false' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' tags: - Organization @@ -115,6 +142,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/{organization-id}?includePermissions=false' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' tags: - Organization patch: @@ -151,6 +185,21 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/{organization-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "operation": "REPLACE", + "path": "/name", + "value": "XYZ Builders" + } + ]' tags: - Organization put: @@ -187,6 +236,25 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/{organization-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "name": "ABC Builders", + "description": "Building constructions", + "status": "ACTIVE", + "attributes": [ + { + "key": "Country", + "value": "Sri Lanka" + } + ] + }' tags: - Organization delete: @@ -213,6 +281,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations/{organization-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' tags: - Organization components: From d5c0ae54d1e36ced03da8ba30baf3889e806b502 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 11:04:27 +0530 Subject: [PATCH 19/26] fixed issues in org-management.yaml --- en/asgardeo/docs/apis/restapis/org-management.yaml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/org-management.yaml b/en/asgardeo/docs/apis/restapis/org-management.yaml index bc9562e006..aaf275975a 100644 --- a/en/asgardeo/docs/apis/restapis/org-management.yaml +++ b/en/asgardeo/docs/apis/restapis/org-management.yaml @@ -2,20 +2,19 @@ openapi: 3.0.0 info: version: "v1" title: 'Asgardeo - Organization Management API Definition' - description: 'This is the RESTful API for organization management in Asgardeo. This API allows users to create, - update, retrieve and delete organizations.

+ description: | + 'This is the RESTful API for organization management in Asgardeo. This API allows users to create, + update, retrieve and delete organizations.

- Important:
- You need a paid Asgardeo subscription to create hierarchical organizations. If you don't already have one, - view the available [subscription plans](https://wso2.com/asgardeo/pricing/) and contact the Asgardeo sales team. - ' + Important:
+ You need a paid Asgardeo subscription to create hierarchical organizations. If you don't already have one, view the available [subscription plans](https://wso2.com/asgardeo/pricing/) and contact the Asgardeo sales team.' servers: - url: 'https://api.asgardeo.io/o/{organization-id}/api/server/v1/organizations' variables: server-url: default: https://api.asgardeo.io/o/{organization-id} organization-id: - default: {organization-id} + default: organization-id security: - OAuth2: [] paths: From e79aa6ee28b8fb586e07ab9848f80371a62a18fc Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 11:35:47 +0530 Subject: [PATCH 20/26] added curls to org-scim2.yaml --- en/asgardeo/docs/apis/restapis/org-scim2.yaml | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/org-scim2.yaml b/en/asgardeo/docs/apis/restapis/org-scim2.yaml index fc5e24b733..68cac45bf8 100644 --- a/en/asgardeo/docs/apis/restapis/org-scim2.yaml +++ b/en/asgardeo/docs/apis/restapis/org-scim2.yaml @@ -82,6 +82,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Groups Endpoint @@ -138,6 +145,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErroGroupAlreadyAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' x-codegen-request-body-name: body /Groups/.search: post: @@ -173,6 +187,21 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups/.search' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:SearchRequest" + ], + "startIndex": 1, + "filter": "displayName eq manager" + }' x-codegen-request-body-name: body /Groups/{id}: get: @@ -225,6 +254,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Groups Endpoint @@ -287,6 +323,23 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "displayName": "manager", + "members": [ + { + "value": "409ca90b-2ba6-4474-9a45-2cf7376e6e43", + "display": "kris" + } + ] + }' x-codegen-request-body-name: body delete: tags: @@ -325,6 +378,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups/{group-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Groups Endpoint @@ -381,6 +441,32 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "members": [ + { + "display": "kris", + "value": "409ca90b-2ba6-4474-9a45-2cf7376e6e43" + } + ] + } + } + ] + }' x-codegen-request-body-name: body /Users: get: @@ -443,6 +529,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Users Endpoint @@ -501,6 +594,37 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorInternalServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [], + "name": { + "givenName": "Kim", + "familyName": "Berry" + }, + "userName": "DEFAULT/kim@gmail.com", + "password": "aBcd!23#", + "emails": [ + { + "value": "kim@gmail.com", + "primary": true + } + ], + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "manager": { + "value": "Taylor" + } + }, + "urn:scim:wso2:schema": { + "verifyEmail": true + } + }' x-codegen-request-body-name: body /Users/.search: post: @@ -536,6 +660,27 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users/.search' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:SearchRequest" + ], + "attributes": [ + "name.familyName", + "userName" + ], + "filter": "userName sw ki and name.familyName co err", + "domain": "PRIMARY", + "startIndex": 1, + "count": 10 + }' x-codegen-request-body-name: body /Users/{id}: get: @@ -588,6 +733,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Users Endpoint @@ -644,6 +796,33 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [], + "name": { + "givenName": "Kim", + "familyName": "Berry" + }, + "userName": "DEFAULT/kim@gmail.com", + "emails": [ + { + "value": "kim@gmail.com", + "primary": true + } + ], + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "manager": { + "value": "Taylor" + } + } + }' x-codegen-request-body-name: body delete: tags: @@ -682,6 +861,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users/{user-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Users Endpoint @@ -739,6 +925,27 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "nickName": "shaggy" + } + } + ] + }' x-codegen-request-body-name: body components: schemas: From 8355d3685a5846dccac3a3d2c571d48d721b584a Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 11:51:22 +0530 Subject: [PATCH 21/26] added curls to organization-role-management.yaml --- .../organization-role-management.yaml | 95 +++++++++++++++++-- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/en/asgardeo/docs/apis/restapis/organization-role-management.yaml b/en/asgardeo/docs/apis/restapis/organization-role-management.yaml index 13703c4010..c09fd2f1f6 100644 --- a/en/asgardeo/docs/apis/restapis/organization-role-management.yaml +++ b/en/asgardeo/docs/apis/restapis/organization-role-management.yaml @@ -3,13 +3,6 @@ openapi: 3.0.0 info: title: Asgardeo - Organizational Role Management description: This is the RESTful API for managing organizational roles in Asgardeo. This API allows users to create, update, retrieve, and delete organization roles. - #contact: - # name: WSO2 - # url: http://wso2.com/products/identity-server - # email: iam-dev@wso2.org - #license: - # name: Apache 2.0 - # url: http://www.apache.org/licenses/LICENSE-2.0.html version: v1 servers: - url: https://api.asgardeo.io/o/{suborganization-id}/api/server/v1/organizations @@ -85,6 +78,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Organization Role Management @@ -142,6 +142,30 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "displayName": "loginRole", + "users": [ + { + "value": "008bba85-451d-414b-87de-c03b5a1f4217" + } + ], + "groups": [ + { + "value": "7bac6a86-1f21-4937-9fb1-5be4a93ef469" + } + ], + "permissions": [ + "/permission/admin/login" + ] + }' /{organization-id}/roles/{role-id}: get: tags: @@ -188,6 +212,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles/{role-id}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Organization Role Management @@ -246,6 +277,30 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles/{role-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "displayName": "loginRole", + "users": [ + { + "value": "409ca90b-2ba6-4474-9a45-2cf7376e6e43" + } + ], + "groups": [ + { + "value": "7bac6a86-1f21-4937-9fb1-5be4a93ef469" + } + ], + "permissions": [ + "/permission/admin/manage/add" + ] + }' delete: tags: - Organization Role Management @@ -287,6 +342,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles/{role-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Organization Role Management @@ -345,6 +407,25 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{sub-organization-id}/api/server/v1/organizations/{organization-id}/roles/{role-id}' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "operations": [ + { + "op": "ADD", + "path": "groups", + "value": [ + "7bac6a86-1f21-4937-9fb1-5be4a93ef469" + ] + } + ] + }' components: schemas: Error: From 174843039b243445317c98d39f42f806417b3e45 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 12:00:07 +0530 Subject: [PATCH 22/26] added curls to password-recovery.yaml --- .../docs/apis/restapis/password-recovery.yaml | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/password-recovery.yaml b/en/asgardeo/docs/apis/restapis/password-recovery.yaml index 0eb9b07696..2632889543 100644 --- a/en/asgardeo/docs/apis/restapis/password-recovery.yaml +++ b/en/asgardeo/docs/apis/restapis/password-recovery.yaml @@ -110,6 +110,28 @@ paths: message: Internal Error description: Internal Error. traceId: 23456fghj678vb78 + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v2/recovery/password/init' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "claims": [ + { + "uri": "http://wso2.org/claims/givenname", + "value": "user1" + } + ], + "properties": [ + { + "key": "key", + "value": "value" + } + ] + }' requestBody: content: application/json: @@ -219,6 +241,24 @@ paths: message: Internal Error description: Internal Error traceId: 23456fghj678vb78 + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v2/recovery/password/recover' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "recoveryCode": "1234-5678-2455-3433", + "channelId": "1", + "properties": [ + { + "key": "key", + "value": "value" + } + ] + }' requestBody: content: application/json: @@ -315,6 +355,23 @@ paths: message: Internal Error description: Internal Error traceId: 23456fghj678vb78 + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v2/recovery/password/resend' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "resendCode": "1234-2ws34-1234", + "properties": [ + { + "key": "key", + "value": "value" + } + ] + }' requestBody: content: application/json: @@ -405,6 +462,24 @@ paths: message: Internal Error description: Internal Error traceId: 23456fghj678vb78 + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v2/recovery/password/confirm' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "confirmationCode": "1234-2ws34-12345", + "otp": "wi8Ivm", + "properties": [ + { + "key": "key", + "value": "value" + } + ] + }' requestBody: content: application/json: @@ -509,6 +584,25 @@ paths: message: Internal Error description: Internal Error traceId: 23456fghj678vb78 + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v2/recovery/password/reset' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "resetCode": "string", + "flowConfirmationCode": "string", + "password": "string", + "properties": [ + { + "key": "key", + "value": "value" + } + ] + }' requestBody: content: application/json: From af34d73dbf99b7d6e941f717e5f3e3245de5f45a Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 12:24:18 +0530 Subject: [PATCH 23/26] added curls to scim2.yaml --- en/asgardeo/docs/apis/restapis/scim2.yaml | 306 +++++++++++++++++++++- 1 file changed, 305 insertions(+), 1 deletion(-) diff --git a/en/asgardeo/docs/apis/restapis/scim2.yaml b/en/asgardeo/docs/apis/restapis/scim2.yaml index c05a5d1139..5d845de3cb 100644 --- a/en/asgardeo/docs/apis/restapis/scim2.yaml +++ b/en/asgardeo/docs/apis/restapis/scim2.yaml @@ -60,6 +60,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/Me' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Me Endpoint @@ -104,6 +111,33 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/Me' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [], + "name": { + "givenName": "Kim", + "familyName": "Berry" + }, + "userName": "DEFAULT/kim@gmail.com", + "emails": [ + { + "value": "kim@gmail.com", + "primary": true + } + ], + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "manager": { + "value": "Taylor" + } + } + }' patch: tags: - Me Endpoint @@ -148,6 +182,27 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/Me' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "nickName": "shaggy" + } + } + ] + }' x-codegen-request-body-name: body /Groups: get: @@ -210,6 +265,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Groups Endpoint @@ -266,6 +328,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErroGroupAlreadyAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' x-codegen-request-body-name: body /Groups/.search: post: @@ -301,6 +370,21 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups/.search' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:SearchRequest" + ], + "startIndex": 1, + "filter": "displayName eq manager" + }' x-codegen-request-body-name: body /Groups/{id}: get: @@ -353,6 +437,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Groups Endpoint @@ -415,6 +506,23 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "displayName": "manager", + "members": [ + { + "value": "409ca90b-2ba6-4474-9a45-2cf7376e6e43", + "display": "kris" + } + ] + }' x-codegen-request-body-name: body delete: tags: @@ -453,6 +561,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups/{group-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Groups Endpoint @@ -509,6 +624,32 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorNoGroupAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Groups/{group-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "members": [ + { + "display": "kris", + "value": "409ca90b-2ba6-4474-9a45-2cf7376e6e43" + } + ] + } + } + ] + }' x-codegen-request-body-name: body /Users: get: @@ -571,6 +712,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' post: tags: - Users Endpoint @@ -629,6 +777,37 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorInternalServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [], + "name": { + "givenName": "Kim", + "familyName": "Berry" + }, + "userName": "DEFAULT/kim@gmail.com", + "password": "aBcd!23#", + "emails": [ + { + "value": "kim@gmail.com", + "primary": true + } + ], + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "manager": { + "value": "Taylor" + } + }, + "urn:scim:wso2:schema": { + "verifyEmail": true + } + }' x-codegen-request-body-name: body /Users/.search: post: @@ -664,6 +843,27 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorForbidden' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users/.search' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:SearchRequest" + ], + "attributes": [ + "name.familyName", + "userName" + ], + "filter": "userName sw ki and name.familyName co err", + "domain": "PRIMARY", + "startIndex": 1, + "count": 10 + }' x-codegen-request-body-name: body /Users/{id}: get: @@ -716,6 +916,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Users Endpoint @@ -772,6 +979,33 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [], + "name": { + "givenName": "Kim", + "familyName": "Berry" + }, + "userName": "DEFAULT/kim@gmail.com", + "emails": [ + { + "value": "kim@gmail.com", + "primary": true + } + ], + "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": { + "manager": { + "value": "Taylor" + } + } + }' x-codegen-request-body-name: body delete: tags: @@ -810,6 +1044,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users/{user-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' patch: tags: - Users Endpoint @@ -867,6 +1108,27 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorUserNotAvailable' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PATCH' \ + 'https://api.asgardeo.io/o/{organization-name}/scim2/Users/{user-id}' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:PatchOp" + ], + "Operations": [ + { + "op": "add", + "value": { + "nickName": "shaggy" + } + } + ] + }' x-codegen-request-body-name: body /Bulk: post: @@ -877,7 +1139,7 @@ paths:
- **POST** operation: Adds new resources.
- **PUT** operation: Replaces an existing resource.
- - **PATCH** opearation: Updates attribues of an existing resource.
+ - **PATCH** operation: Updates attribues of an existing resource.
- **DELETE** operation: Removes an existing resource.
- Scopes required: ``internal_user_mgt_create`` ``internal_user_mgt_list`` ``internal_user_mgt_view`` @@ -919,6 +1181,34 @@ paths: 409: description: Users already exists content: {} + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/Bulk' \ + -H 'accept: application/scim+json' \ + -H 'Content-Type: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "failOnErrors": 1, + "schemas": [ + "urn:ietf:params:scim:api:messages:2.0:BulkRequest" + ], + "Operations": [ + { + "method": "POST", + "path": "/Users", + "bulkId": "ytrewq", + "data": { + "schemas": [ + "urn:ietf:params:scim:schemas:core:2.0:User" + ], + "userName": "DEFAULT/kim@gmail.com", + "password": "Pass@kim1" + } + } + ] + }' x-codegen-request-body-name: body /ResourceTypes: get: @@ -946,6 +1236,13 @@ paths: application/scim+json: schema: $ref: '#/components/schemas/ErrorSchemaNotFound' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/ResourceTypes' \ + -H 'accept: application/scim+json' \ + -H 'Authorization: Bearer {bearer_token}' /ServiceProviderConfig: get: tags: @@ -972,6 +1269,13 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorSchemaNotFound' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/scim2/ServiceProviderConfig' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: UserObject: From f7c448f29b14c281b72ac98a0999fe39769bdf23 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 12:41:49 +0530 Subject: [PATCH 24/26] added curls to session.yaml --- en/asgardeo/docs/apis/restapis/session.yaml | 42 +++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/session.yaml b/en/asgardeo/docs/apis/restapis/session.yaml index a08680fb7c..a5069c00cb 100644 --- a/en/asgardeo/docs/apis/restapis/session.yaml +++ b/en/asgardeo/docs/apis/restapis/session.yaml @@ -63,6 +63,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/sessions' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' delete: tags: - me @@ -92,6 +99,13 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/sessions' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' /me/sessions/{session-id}: delete: tags: @@ -129,6 +143,13 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/sessions/{session-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' /{user-id}/sessions: get: tags: @@ -173,6 +194,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/{user-id}/sessions' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' delete: tags: - admin @@ -206,6 +234,13 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/{user-id}/sessions' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' /{user-id}/sessions/{session-id}: delete: tags: @@ -246,6 +281,13 @@ paths: '*/*': schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/{user-id}/sessions/{session-id}' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Application: From d7c859fadd6cd1462182ed7e13e58016c0e51f2b Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 12:42:06 +0530 Subject: [PATCH 25/26] added curls to totp.yaml --- en/asgardeo/docs/apis/restapis/totp.yaml | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/en/asgardeo/docs/apis/restapis/totp.yaml b/en/asgardeo/docs/apis/restapis/totp.yaml index 617d94cc01..6161a0148f 100644 --- a/en/asgardeo/docs/apis/restapis/totp.yaml +++ b/en/asgardeo/docs/apis/restapis/totp.yaml @@ -65,6 +65,18 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'POST' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/totp' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "action": "INIT, REFRESH, VALIDATE", + "verificationCode": 0 + }' + tags: - me get: @@ -90,6 +102,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/totp' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' delete: tags: - me @@ -109,6 +128,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' + x-codeSamples: + - lang: Curl + source: | + curl -X 'DELETE' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/totp' \ + -H 'accept: */*' \ + -H 'Authorization: Bearer {bearer_token}' /me/totp/secret: get: tags: @@ -133,7 +159,13 @@ paths: application/json: schema: $ref: '#/components/schemas/Error' - + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/users/v1/me/totp/secret' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: Error: From 49ba3c6ce73f23515ff7f17592495c87ea4f56c2 Mon Sep 17 00:00:00 2001 From: wso2 Date: Fri, 10 Nov 2023 12:52:20 +0530 Subject: [PATCH 26/26] added curls to validation.yaml --- .../docs/apis/restapis/validation.yaml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/en/asgardeo/docs/apis/restapis/validation.yaml b/en/asgardeo/docs/apis/restapis/validation.yaml index ebf2bbef4b..68c916364d 100644 --- a/en/asgardeo/docs/apis/restapis/validation.yaml +++ b/en/asgardeo/docs/apis/restapis/validation.yaml @@ -27,6 +27,13 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/validation-rules' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Validation Rules @@ -72,6 +79,34 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/validation-rules' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '[ + { + "field": "password/username", + "rules": [ + { + "validator": "LengthValidator", + "properties": [ + { + "key": "min.length", + "value": 5 + }, + { + "key": "max.length", + "value": 15 + } + ] + } + ] + } + ]' /validation-rules/{field}: get: tags: @@ -100,6 +135,13 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/validation-rules/{field-name}' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' put: tags: - Validation Rules for a specific field @@ -145,6 +187,31 @@ paths: $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'PUT' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/validation-rules/field-name' \ + -H 'accept: application/json' \ + -H 'Content-Type: application/json' \ + -H 'Authorization: Bearer {bearer_token}' \ + -d '{ + "rules": [ + { + "validator": "LengthValidator", + "properties": [ + { + "key": "min.length", + "value": 5 + }, + { + "key": "max.length", + "value": 15 + } + ] + } + ] + }' /validation-rules/validators: get: tags: @@ -168,6 +235,13 @@ paths: $ref: '#/components/responses/Forbidden' '500': $ref: '#/components/responses/ServerError' + x-codeSamples: + - lang: Curl + source: | + curl -X 'GET' \ + 'https://api.asgardeo.io/t/{organization-name}/api/server/v1/validation-rules/validators' \ + -H 'accept: application/json' \ + -H 'Authorization: Bearer {bearer_token}' components: schemas: ValidatorModel: