Consume ntm-channel-service

This service allows an API consumer to create and manage their channel. A development team could choose between channel type as public or private based on the consumer needs and messaging behavior. Once created an NTM channel could be used to publish messages. A channel owner could convert their channel from private -> public or vice versa at any point in time of the channel lifecycle. This service also gives an auto-approval feature where subscriptions created on this channel will be automatically approved. Public Channels automatically have this feature enabled. For Private Channels, the Channel owners will have to explicitly specify if they want to keep auto-approval to true or false.

Public Vs Private Channels

Public Channel:

  • A channel where subscriptions are pre-approved and does not require channel owner’s manual approval.
  • Auto approval flag will be true in case of public channels.

Private Channel:

  • A channel where subscriptions require channel owner manual approval.
  • A channel owner will be able to provide approval via NTM-Subscribe-Service API.
  • The subscription will come into effect post approval from channel owner.
  • While creating a channel we can specify the auto approval flag to be true or false.

Channel access-type transitions:

A channel owner can convert the channel from public-to-private or private-to-public

When a channel is converted from:

Public to Private:

  • All pre-approved existing subscriptions will continue to be in effect.
  • The channel owners need to manually revoke the subscriptions, if required

Private to Public:

  • All pre-approved existing subscriptions will continue to be in effect.
  • All the pending subscriptions will be approved.
  • All the denied and revoked subscriptions will remain in the same status.

Conditions:

  • Channel Name must be unique across the NTM
  • Each client identity can have only one channel, considering each application having one client identity

Channel service allows applications to:

  1. Get a list of all channels present in NTM.
  2. Create a new channel with NTM.

Sample Requests:

POST: v1/channel

A channel will be created with NTM. An Application can create only one channel with NTM, however it is allowed to update the access type of the channel from private to public and vice versa. By default, channel with accessType of private will and auto approval as false will be created else you need to create channel with v2.

ScenariosSample cUrlSample Output
Scenario 1: When a user creates a channel with NTM for the first time.

For example, when a user wants to create a channel with the name “ntm”.
curl -X POST \
  'https://api.delfi.slb.com/ntm/v1/channel' \
  -H 'Authorization: Bearer <your-ccg-token>' \
  -H 'AppKey: <your-appkey>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
        "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
        "channelName": "ntm"
   }'
{
  "Message": "Channel created successfully"
}

POST: v2/channel

A channel will be created with NTM. An Application can create only one channel with NTM, however it is allowed to update the access type of the channel from public to private and vice versa.

ScenariosSample cUrlSample Output
Scenario 1: When a user creates a channel with NTM for the first time. For example, when a user wants to create a channel with the name “ntm” and auto approval feature as false.curl -X POST \
  'https://api.delfi.slb.com/ntm/v2/channel' \
  -H 'Authorization: Bearer <your-ccg-token>' \
  -H 'AppKey: <your-appkey>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
        "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
        "channelName": "ntm",
        "accessType": "private",
        "autoApproval": false
   }'
{
  "Message": "Channel created successfully"
}
Scenario 2: When a user creates a channel with NTM for the first time. For example, when a user wants to create a channel with the name “ntm” and want to opt for auto approval feature.curl -X POST \
  'https://api.delfi.slb.com/ntm/v2/channel' \
  -H 'Authorization: Bearer <your-ccg-token>' \
  -H 'AppKey: <your-appkey>' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -d '{
        "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
        "channelName": "ntm",
        "accessType": "public",
        "autoApproval": true
   }'
{
  "Message": "Channel created successfully"
}

GET: /channel
Get all channels

Sample cUrlSample Output
curl -X GET \
   'https://api.delfi.slb.com/ntm/channel/v1/channel' \
   -H 'Authorization: Bearer <your-ccg-token>' \
   -H 'AppKey: <your-appkey>' \
   -H 'Cache-Control: no-cache' \
[
     {
         "accessType": "private",
         "appId": "ntm-master-svc-ntm.slbservice.com",
         "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
         "channelId": "bc7ab839-dc17-47ae-a72e-34642f42e96f",
         "channelName": "ntm",
        "autoApproval": false
     }
]

GET: v2/channel
Get all channels in paginated fashion

Sample cUrlSample Output
curl -X GET \
   'https://api.delfi.slb.com/ntm/channel/v2/channel' \
   -H 'Authorization: Bearer <your-ccg-token>' \
   -H 'AppKey: <your-appkey>' \
   -H 'Cache-Control: no-cache' \
[
     {
         "accessType": "private",
         "appId": "ntm-master-svc-ntm.slbservice.com",
         "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
         "channelId": "bc7ab839-dc17-47ae-a72e-34642f42e96f",
         "channelName": "ntm",
        "autoApproval": false
     }
]

GET: /channel/{channel_id}
Get details of a specific channel

Sample cUrlSample Output
curl -X GET \
   'https://api.delfi.slb.com/ntm/channel/v1/channel/bc7ab839-dc17-47ae-a72e-34642f42e96f' \
   -H 'Authorization: Bearer <your-ccg-token>' \
   -H 'AppKey: <your-appkey>' \
   -H 'Cache-Control: no-cache' \
{
         "accessType": "private",
         "appId": "ntm-master-svc-ntm.slbservice.com",
         "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
         "channelId": "bc7ab839-dc17-47ae-a72e-34642f42e96f",
         "channelName": "ntm",
        "autoApproval": false
     }

PUT: /channel/{channel_id}
Update the channel details

Sample cUrlSample Output
curl -X PUT \
   'https://api.delfi.slb.com/ntm/v1/channel/bc7ab839-dc17-47ae-a72e-34642f42e96f' \
   -H 'Authorization: Bearer <your-user-exchanged-token>' \
   -H 'AppKey: <your-appkey>' \
   -H 'Cache-Control: no-cache' \
   -H 'Content-Type: application/json' \
   -d '{
        "channelDescription": "This is a channel created for ntm. NTM stands for Notification and TaskManagement.",
        "channelName": "ntm",
        "accessType": "private",
        "autoApproval": false
   }
{
  "Message": "Conversion process initiated successfully. Please wait a while."
}