Difference between revisions of "PEC-Developer/Current/SCAPI/AuthNamespace"
From Genesys Documentation
(Published) |
|||
(One intermediate revision by one other user not shown) | |||
Line 6: | Line 6: | ||
|Role=Developer | |Role=Developer | ||
|Section={{Section | |Section={{Section | ||
+ | |alignment=Vertical | ||
+ | |structuredtext={{NoteFormat|Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.|}} | ||
+ | |Status=No | ||
+ | }}{{Section | ||
|sectionHeading=Methods | |sectionHeading=Methods | ||
|anchor=Methods | |anchor=Methods | ||
Line 11: | Line 15: | ||
|structuredtext=The Auth namespace includes the following methods: | |structuredtext=The Auth namespace includes the following methods: | ||
− | *{{Link- | + | *{{Link-SomewhereInThisVersion|manual=SCAPI|topic=AuthNamespace|anchor=getJwtToken|display text=getJwtToken}} |
===getJwtToken=== | ===getJwtToken=== | ||
− | To use the <tt>auth.getJwtToken</tt> endpoint, you must explicitly define the full endpoint name in the | + | To use the <tt>auth.getJwtToken</tt> endpoint, you must explicitly define the full endpoint name in the [https://docs.genesys.com/Documentation/Options/Current/HTCC/GWS-interaction-workspace#service-client-api-accepted-web-content-origins service-client-api-accepted-web-content-origins] option. For example: <code>service-client-api.accepted-web-content-origins = https://genesyspureengage.github.io (*, auth.getJwtToken)</code> |
{{{!}} | {{{!}} | ||
Line 31: | Line 35: | ||
{{!}}- | {{!}}- | ||
{{!}}succeeded | {{!}}succeeded | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation succeeds. |
{{!}}- | {{!}}- | ||
{{!}}failed | {{!}}failed | ||
− | {{!}} | + | {{!}}function |
− | {{!}} | + | {{!}}A function called when the operation fails. |
{{!}}} | {{!}}} | ||
{{!}}- | {{!}}- | ||
Line 43: | Line 47: | ||
<source lang="json"> | <source lang="json"> | ||
"data": { | "data": { | ||
− | + | "expiration": "2020-04-14T13:26:51.846Z", | |
− | + | "jwtToken": "<your_jwt_token>" | |
− | + | } | |
</source> | </source> | ||
{{!}}} | {{!}}} |
Latest revision as of 13:44, February 22, 2023
Contents
Learn about the Auth namespace methods and type definitions in the Service Client API.
Important
Depending on your environment, you might need to contact your Genesys representative to complete the configuration described on this page.Methods
The Auth namespace includes the following methods:
getJwtToken
To use the auth.getJwtToken endpoint, you must explicitly define the full endpoint name in the service-client-api-accepted-web-content-origins option. For example: service-client-api.accepted-web-content-origins = https://genesyspureengage.github.io (*, auth.getJwtToken)
Signature | <static> getJwtToken(succeeded, failed) → {JSON object} | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Description | Get the JWT access token for the current session. If the token is already generated and still valid, it is returned; otherwise a new token is returned. | |||||||||
Parameters |
| |||||||||
Returns | JSON data object with the token and its expiration date in
ISO 8601 date format.
"data": {
"expiration": "2020-04-14T13:26:51.846Z",
"jwtToken": "<your_jwt_token>"
} |
Comments or questions about this documentation? Contact us for support!