okta-sdk-nodejs

okta.SubscriptionApi

All URIs are relative to https://subdomain.okta.com

Method HTTP request Description
getRoleSubscriptionByNotificationType GET /api/v1/roles/{roleTypeOrRoleId}/subscriptions/{notificationType} List all Subscriptions of a Custom Role with a specific notification type
getUserSubscriptionByNotificationType GET /api/v1/users/{userId}/subscriptions/{notificationType} List all Subscriptions by type
listRoleSubscriptions GET /api/v1/roles/{roleTypeOrRoleId}/subscriptions List all Subscriptions of a Custom Role
listUserSubscriptions GET /api/v1/users/{userId}/subscriptions List all Subscriptions
subscribeRoleSubscriptionByNotificationType POST /api/v1/roles/{roleTypeOrRoleId}/subscriptions/{notificationType}/subscribe Subscribe a Custom Role to a specific notification type
subscribeUserSubscriptionByNotificationType POST /api/v1/users/{userId}/subscriptions/{notificationType}/subscribe Subscribe to a specific notification type
unsubscribeRoleSubscriptionByNotificationType POST /api/v1/roles/{roleTypeOrRoleId}/subscriptions/{notificationType}/unsubscribe Unsubscribe a Custom Role from a specific notification type
unsubscribeUserSubscriptionByNotificationType POST /api/v1/users/{userId}/subscriptions/{notificationType}/unsubscribe Unsubscribe from a specific notification type

getRoleSubscriptionByNotificationType

Subscription getRoleSubscriptionByNotificationType()

When roleType Get subscriptions of a Role with a specific notification type. Else when roleId Get subscription of a Custom Role with a specific notification type.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiGetRoleSubscriptionByNotificationTypeRequest = {
  // string
  roleTypeOrRoleId: "roleTypeOrRoleId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.getRoleSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
roleTypeOrRoleId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

Subscription

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getUserSubscriptionByNotificationType

Subscription getUserSubscriptionByNotificationType()

Get the subscriptions of a User with a specific notification type. Only gets subscriptions for current user. An AccessDeniedException message is sent if requests are made from other users.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiGetUserSubscriptionByNotificationTypeRequest = {
  // string
  userId: "userId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.getUserSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
userId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

Subscription

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listRoleSubscriptions

Array listRoleSubscriptions()

When roleType List all subscriptions of a Role. Else when roleId List subscriptions of a Custom Role

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiListRoleSubscriptionsRequest = {
  // string
  roleTypeOrRoleId: "roleTypeOrRoleId_example",
};

apiInstance.listRoleSubscriptions(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
roleTypeOrRoleId [string]   defaults to undefined

Return type

**Array**

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listUserSubscriptions

Array listUserSubscriptions()

List subscriptions of a User. Only lists subscriptions for current user. An AccessDeniedException message is sent if requests are made from other users.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiListUserSubscriptionsRequest = {
  // string
  userId: "userId_example",
};

apiInstance.listUserSubscriptions(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
userId [string]   defaults to undefined

Return type

**Array**

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

subscribeRoleSubscriptionByNotificationType

void subscribeRoleSubscriptionByNotificationType()

When roleType Subscribes a Role to a specific notification type. When you change the subscription status of a Role, it overrides the subscription of any individual user of that Role. Else when roleId Subscribes a Custom Role to a specific notification type. When you change the subscription status of a Custom Role, it overrides the subscription of any individual user of that Custom Role.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiSubscribeRoleSubscriptionByNotificationTypeRequest = {
  // string
  roleTypeOrRoleId: "roleTypeOrRoleId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.subscribeRoleSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
roleTypeOrRoleId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

subscribeUserSubscriptionByNotificationType

void subscribeUserSubscriptionByNotificationType()

Subscribes a User to a specific notification type. Only the current User can subscribe to a specific notification type. An AccessDeniedException message is sent if requests are made from other users.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiSubscribeUserSubscriptionByNotificationTypeRequest = {
  // string
  userId: "userId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.subscribeUserSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
userId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

unsubscribeRoleSubscriptionByNotificationType

void unsubscribeRoleSubscriptionByNotificationType()

When roleType Unsubscribes a Role from a specific notification type. When you change the subscription status of a Role, it overrides the subscription of any individual user of that Role. Else when roleId Unsubscribes a Custom Role from a specific notification type. When you change the subscription status of a Custom Role, it overrides the subscription of any individual user of that Custom Role.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiUnsubscribeRoleSubscriptionByNotificationTypeRequest = {
  // string
  roleTypeOrRoleId: "roleTypeOrRoleId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.unsubscribeRoleSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
roleTypeOrRoleId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]

unsubscribeUserSubscriptionByNotificationType

void unsubscribeUserSubscriptionByNotificationType()

Unsubscribes a User from a specific notification type. Only the current User can unsubscribe from a specific notification type. An AccessDeniedException message is sent if requests are made from other users.

Example

import { okta } from '@okta/okta-sdk-nodejs';
import * as fs from 'fs';

const configuration = okta.createConfiguration();
const apiInstance = new okta.SubscriptionApi(configuration);

let body:okta.SubscriptionApiUnsubscribeUserSubscriptionByNotificationTypeRequest = {
  // string
  userId: "userId_example",
  // string
  notificationType: "notificationType_example",
};

apiInstance.unsubscribeUserSubscriptionByNotificationType(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
userId [string]   defaults to undefined
notificationType [string]   defaults to undefined

Return type

void

Authorization

API_Token, OAuth_2.0

HTTP request headers

HTTP response details

| Status code | Description | Response headers | |————-|————-|——————| 200 | Success | - | 403 | Forbidden | - | 404 | Not Found | - | 429 | Too Many Requests | - |

[Back to top] [Back to API list] [Back to Model list] [Back to README]