Skip to content

Commit 67db074

Browse files
author
PureCloud Jenkins
committed
249.1.0
1 parent 49c0bc7 commit 67db074

190 files changed

Lines changed: 117566 additions & 40472 deletions

File tree

Some content is hidden

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

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A JavaScript library to interface with the Genesys Cloud Platform API. View the
66
[![npm](https://img.shields.io/npm/v/purecloud-platform-client-v2.svg)](https://www.npmjs.com/package/purecloud-platform-client-v2)
77
[![Release Notes Badge](https://developer-content.genesys.cloud/images/sdk-release-notes.png)](https://github.com/MyPureCloud/platform-client-sdk-javascript/blob/master/releaseNotes.md)
88

9-
Documentation version purecloud-platform-client-v2@249.0.0
9+
Documentation version purecloud-platform-client-v2@249.1.0
1010

1111
## Preview APIs
1212

@@ -29,7 +29,7 @@ For direct use in a browser script:
2929

3030
```html
3131
<!-- Include the CJS SDK -->
32-
<script src="https://sdk-cdn.mypurecloud.com/javascript/249.0.0/purecloud-platform-client-v2.min.js"></script>
32+
<script src="https://sdk-cdn.mypurecloud.com/javascript/249.1.0/purecloud-platform-client-v2.min.js"></script>
3333

3434
<script type="text/javascript">
3535
// Obtain a reference to the platformClient object
@@ -46,7 +46,7 @@ For direct use in a browser script:
4646

4747
<script type="text/javascript">
4848
// Obtain a reference to the platformClient object
49-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/249.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
49+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/249.1.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
5050
console.log(platformClient);
5151
});
5252
</script>
@@ -530,6 +530,37 @@ client.loginImplicitGrant(clientId, redirectUri)
530530
});
531531
```
532532

533+
### Setting Custom Headers per Request
534+
535+
The SDK now allows setting custom headers per API Request.
536+
Each API method includes an optional parameter structure (**opts**), which supports an optional parameter named **customHeaders**. The **customHeaders** is a string map, that you can use to set custom headers on the corresponding API request.
537+
538+
```javascript
539+
// Create API instance
540+
const usersApi = new platformClient.UsersApi();
541+
542+
// Authenticate
543+
client.loginClientCredentialsGrant(clientId, clientSecret)
544+
.then(() => {
545+
// Make request to GET /api/v2/users/{userId}
546+
let opts = {
547+
'customHeaders': { // Object.<string, string> | Request Custom Headers
548+
'X-Service-Name': 'customer-service',
549+
'X-Request-ID': 'req-12345'
550+
}
551+
}
552+
let userId = 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx';
553+
return usersApi.getUser(userId, opts);
554+
})
555+
.then((permissions) => {
556+
// Handle successful result
557+
console.log(permissions);
558+
})
559+
.catch((err) => {
560+
// Handle failure response
561+
console.log(err);
562+
});
563+
```
533564

534565
### Extended Responses
535566

build/APIData.json

Lines changed: 3103 additions & 3103 deletions
Large diffs are not rendered by default.

build/README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ A JavaScript library to interface with the Genesys Cloud Platform API. View the
66
[![npm](https://img.shields.io/npm/v/purecloud-platform-client-v2.svg)](https://www.npmjs.com/package/purecloud-platform-client-v2)
77
[![Release Notes Badge](https://developer-content.genesys.cloud/images/sdk-release-notes.png)](https://github.com/MyPureCloud/platform-client-sdk-javascript/blob/master/releaseNotes.md)
88

9-
Documentation version purecloud-platform-client-v2@249.0.0
9+
Documentation version purecloud-platform-client-v2@249.1.0
1010

1111
## Preview APIs
1212

@@ -29,7 +29,7 @@ For direct use in a browser script:
2929

3030
```html
3131
<!-- Include the CJS SDK -->
32-
<script src="https://sdk-cdn.mypurecloud.com/javascript/249.0.0/purecloud-platform-client-v2.min.js"></script>
32+
<script src="https://sdk-cdn.mypurecloud.com/javascript/249.1.0/purecloud-platform-client-v2.min.js"></script>
3333

3434
<script type="text/javascript">
3535
// Obtain a reference to the platformClient object
@@ -46,7 +46,7 @@ For direct use in a browser script:
4646

4747
<script type="text/javascript">
4848
// Obtain a reference to the platformClient object
49-
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/249.0.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
49+
requirejs(['https://sdk-cdn.mypurecloud.com/javascript/amd/249.1.0/purecloud-platform-client-v2.min.js'], (platformClient) => {
5050
console.log(platformClient);
5151
});
5252
</script>
@@ -530,6 +530,37 @@ client.loginImplicitGrant(clientId, redirectUri)
530530
});
531531
```
532532

533+
### Setting Custom Headers per Request
534+
535+
The SDK now allows setting custom headers per API Request.
536+
Each API method includes an optional parameter structure (**opts**), which supports an optional parameter named **customHeaders**. The **customHeaders** is a string map, that you can use to set custom headers on the corresponding API request.
537+
538+
```javascript
539+
// Create API instance
540+
const usersApi = new platformClient.UsersApi();
541+
542+
// Authenticate
543+
client.loginClientCredentialsGrant(clientId, clientSecret)
544+
.then(() => {
545+
// Make request to GET /api/v2/users/{userId}
546+
let opts = {
547+
'customHeaders': { // Object.<string, string> | Request Custom Headers
548+
'X-Service-Name': 'customer-service',
549+
'X-Request-ID': 'req-12345'
550+
}
551+
}
552+
let userId = 'xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx';
553+
return usersApi.getUser(userId, opts);
554+
})
555+
.then((permissions) => {
556+
// Handle successful result
557+
console.log(permissions);
558+
})
559+
.catch((err) => {
560+
// Handle failure response
561+
console.log(err);
562+
});
563+
```
533564

534565
### Extended Responses
535566

0 commit comments

Comments
 (0)