Skip to content

Commit 3f4b425

Browse files
author
PureCloud Jenkins
committed
185.0.0
1 parent 1458a99 commit 3f4b425

File tree

166 files changed

+9705
-5385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

166 files changed

+9705
-5385
lines changed

README.md

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ For direct use in a browser script:
3131

3232
```html
3333
<!-- Include the CJS SDK -->
34-
<script src="https://sdk-cdn.mypurecloud.com/javascript/184.0.0/purecloud-platform-client-v2.min.js"></script>
34+
<script src="https://sdk-cdn.mypurecloud.com/javascript/185.0.0/purecloud-platform-client-v2.min.js"></script>
3535

3636
<script type="text/javascript">
3737
// Obtain a reference to the platformClient object
@@ -48,7 +48,7 @@ For direct use in a browser script:
4848

4949
<script type="text/javascript">
5050
// Obtain a reference to the platformClient object
51-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/184.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
51+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/185.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
5252
console.log(platformClient);
5353
});
5454
</script>
@@ -160,6 +160,72 @@ client.refreshCodeAuthorizationGrant(clientId,clientSecret,refreshToken)
160160
});
161161
```
162162

163+
**Node.js** [PKCE Grant](https://developer.genesys.cloud/authorization/platform-auth/use-pkce)
164+
165+
```javascript
166+
const client = platformClient.ApiClient.instance;
167+
client.authorizePKCEGrant(clientId,codeVerifier,authCode,redirectUri)
168+
.then(() => {
169+
// Do authenticated things
170+
})
171+
.catch((err) => {
172+
// Handle failure response
173+
console.log(err);
174+
});
175+
```
176+
177+
The SDK also provides methods to generate a PKCE Code Verifier and to compute PKCE Code Challenge.
178+
**This requires Node version 18 (or above). The generatePKCECodeVerifier and computePKCECodeChallenge methods will fail with older Node versions.**
179+
180+
```javascript
181+
let codeVerifier = client.generatePKCECodeVerifier(128);
182+
let codeChallenge = await client.computePKCECodeChallenge(codeVerifier);
183+
```
184+
185+
**Web** [PKCE Grant](https://developer.genesys.cloud/authorization/platform-auth/use-pkce)
186+
187+
The _loginPKCEGrant_ only works when used in a browser. This is because a node.js application does not have a browser interface that can display the Genesys Cloud login window.
188+
189+
Optional parameters may be specified in the optional third parameter for `loginPKCEGrant`. This parameter accepts an object with key/value pairs. Supported properties:
190+
191+
* `state` - An arbitrary string used to associate a login request with a login response. This value will be provided in the `state` property on the object when the promise is resolved. The state in the resolved promise will be identical to what was passed into `loginPKCEGrant`, except when the state is retrieved from the auth query upon completing a login; in that case, the state from the auth query will override the passed in state.
192+
193+
The _loginPKCEGrant_ supports an optional fourth parameter for `loginPKCEGrant`. This parameter accepts a string, used to provide a code verifier as input. When no code verifier is provider (Method 1), the SDK automatically generates a PKCE Code Verifier and saves it in _window sessionStorage_. If a code verifier is provided (Method 2), it is up to the custom application to store the code verifier value and pass it in _loginPKCEGrant_.
194+
195+
```javascript
196+
const client = platformClient.ApiClient.instance;
197+
198+
// Method1: Let loginPKCEGrant generate the code verifier
199+
client.loginPKCEGrant(clientId, redirectUri, { state: state })
200+
.then((data) => {
201+
console.log(data);
202+
// Do authenticated things
203+
})
204+
.catch((err) => {
205+
// Handle failure response
206+
console.log(err);
207+
});
208+
209+
// Method2: code verifier as input parameter
210+
let codeVerifier = client.generatePKCECodeVerifier(128);
211+
client.loginPKCEGrant(clientId, redirectUri, { state: state }, codeVerifier)
212+
.then((data) => {
213+
console.log(data);
214+
// Do authenticated things
215+
})
216+
.catch((err) => {
217+
// Handle failure response
218+
console.log(err);
219+
});
220+
```
221+
222+
The SDK also provides methods to generate a PKCE Code Verifier and to compute PKCE Code Challenge.
223+
224+
```javascript
225+
let codeVerifier = client.generatePKCECodeVerifier(128);
226+
let codeChallenge = await client.computePKCECodeChallenge(codeVerifier);
227+
```
228+
163229
**Web** [Implicit grant](https://developer.genesys.cloud/authorization/platform-auth/use-implicit-grant)
164230

165231
The Implicit grant only works when used in a browser. This is because a node.js application does not have a browser interface that can display the Genesys Cloud login window.

build/.openapi-generator/FILES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ docs/deleteRoutingSmsPhonenumber-example.txt
339339
docs/deleteRoutingUserUtilization-example.txt
340340
docs/deleteRoutingUserUtilization-example.txt
341341
docs/deleteRoutingUtilization-example.txt
342+
docs/deleteRoutingUtilizationLabel-example.txt
342343
docs/deleteRoutingUtilizationTag-example.txt
343344
docs/deleteRoutingWrapupcode-example.txt
344345
docs/deleteScimUser-example.txt
@@ -1198,6 +1199,9 @@ docs/getRoutingSmsPhonenumbers-example.txt
11981199
docs/getRoutingUserUtilization-example.txt
11991200
docs/getRoutingUserUtilization-example.txt
12001201
docs/getRoutingUtilization-example.txt
1202+
docs/getRoutingUtilizationLabel-example.txt
1203+
docs/getRoutingUtilizationLabelAgents-example.txt
1204+
docs/getRoutingUtilizationLabels-example.txt
12011205
docs/getRoutingUtilizationTag-example.txt
12021206
docs/getRoutingUtilizationTagAgents-example.txt
12031207
docs/getRoutingUtilizationTags-example.txt
@@ -1472,12 +1476,15 @@ docs/getWorkforcemanagementBusinessunitWeekSchedule-example.txt
14721476
docs/getWorkforcemanagementBusinessunitWeekScheduleGenerationresults-example.txt
14731477
docs/getWorkforcemanagementBusinessunitWeekScheduleHeadcountforecast-example.txt
14741478
docs/getWorkforcemanagementBusinessunitWeekScheduleHistoryAgent-example.txt
1479+
docs/getWorkforcemanagementBusinessunitWeekSchedulePerformancepredictions-example.txt
1480+
docs/getWorkforcemanagementBusinessunitWeekSchedulePerformancepredictionsRecalculation-example.txt
14751481
docs/getWorkforcemanagementBusinessunitWeekSchedules-example.txt
14761482
docs/getWorkforcemanagementBusinessunitWeekShorttermforecast-example.txt
14771483
docs/getWorkforcemanagementBusinessunitWeekShorttermforecastData-example.txt
14781484
docs/getWorkforcemanagementBusinessunitWeekShorttermforecastGenerationresults-example.txt
14791485
docs/getWorkforcemanagementBusinessunitWeekShorttermforecastLongtermforecastdata-example.txt
14801486
docs/getWorkforcemanagementBusinessunitWeekShorttermforecastPlanninggroups-example.txt
1487+
docs/getWorkforcemanagementBusinessunitWeekShorttermforecastStaffingrequirement-example.txt
14811488
docs/getWorkforcemanagementBusinessunitWeekShorttermforecasts-example.txt
14821489
docs/getWorkforcemanagementBusinessunits-example.txt
14831490
docs/getWorkforcemanagementBusinessunitsDivisionviews-example.txt
@@ -1674,6 +1681,7 @@ docs/patchWorkforcemanagementBusinessunitPlanninggroup-example.txt
16741681
docs/patchWorkforcemanagementBusinessunitSchedulingRun-example.txt
16751682
docs/patchWorkforcemanagementBusinessunitServicegoaltemplate-example.txt
16761683
docs/patchWorkforcemanagementManagementunit-example.txt
1684+
docs/patchWorkforcemanagementManagementunitAgents-example.txt
16771685
docs/patchWorkforcemanagementManagementunitTimeofflimit-example.txt
16781686
docs/patchWorkforcemanagementManagementunitTimeoffplan-example.txt
16791687
docs/patchWorkforcemanagementManagementunitTimeoffrequestUserIntegrationstatus-example.txt
@@ -2137,6 +2145,7 @@ docs/postRoutingSkills-example.txt
21372145
docs/postRoutingSmsAddresses-example.txt
21382146
docs/postRoutingSmsPhonenumbers-example.txt
21392147
docs/postRoutingSmsPhonenumbersImport-example.txt
2148+
docs/postRoutingUtilizationLabels-example.txt
21402149
docs/postRoutingUtilizationTags-example.txt
21412150
docs/postRoutingWrapupcodes-example.txt
21422151
docs/postScimUsers-example.txt
@@ -2255,6 +2264,8 @@ docs/postWorkforcemanagementBusinessunitPlanninggroups-example.txt
22552264
docs/postWorkforcemanagementBusinessunitServicegoaltemplates-example.txt
22562265
docs/postWorkforcemanagementBusinessunitWeekScheduleAgentschedulesQuery-example.txt
22572266
docs/postWorkforcemanagementBusinessunitWeekScheduleCopy-example.txt
2267+
docs/postWorkforcemanagementBusinessunitWeekSchedulePerformancepredictionsRecalculations-example.txt
2268+
docs/postWorkforcemanagementBusinessunitWeekSchedulePerformancepredictionsRecalculationsUploadurl-example.txt
22582269
docs/postWorkforcemanagementBusinessunitWeekScheduleReschedule-example.txt
22592270
docs/postWorkforcemanagementBusinessunitWeekScheduleUpdate-example.txt
22602271
docs/postWorkforcemanagementBusinessunitWeekScheduleUpdateUploadurl-example.txt
@@ -2462,6 +2473,7 @@ docs/putRoutingSmsPhonenumber-example.txt
24622473
docs/putRoutingUserUtilization-example.txt
24632474
docs/putRoutingUserUtilization-example.txt
24642475
docs/putRoutingUtilization-example.txt
2476+
docs/putRoutingUtilizationLabel-example.txt
24652477
docs/putRoutingWrapupcode-example.txt
24662478
docs/putScimGroup-example.txt
24672479
docs/putScimUser-example.txt

0 commit comments

Comments
 (0)