#%RAML 1.0
title: APIs to send and receive messages and SEN from switch
protocols: [ HTTPS ]
version: v1
baseUri: https://ppus.bhumaitc.com/api/{version}
mediaType: application/json
securedBy: oauth_2_0
securitySchemes:
oauth_2_0:
description: |
This API supports OAuth 2.0 for authenticating all API requests.
type: OAuth 2.0
describedBy:
headers:
Authorization:
description: |
Used to send a valid OAuth 2 access token. Do not use
with the "access_token" query string parameter.
type: string
queryParameters:
access_token:
description: |
Used to send a valid OAuth 2 access token. Do not use with
the "Authorization" header.
type: string
responses:
401:
description: |
Bad or expired token. This can happen if the access token
has been revoked or expired. To fix, re-authenticate
the user.
403:
description: |
Bad OAuth request (wrong consumer key, bad nonce, expired
timestamp...). Unfortunately, re-authenticating the user
won't help here. Please ask system admin to grant required
permissions.
settings:
accessTokenUri: https://ppus.bhumaitc.com/auth/token
authorizationGrants: [ client_credentials ]
types:
MessageReq:
type: |
{
title: MessageReq,
type: object,
properties: {
message: {
type: string,
description: |
JSON escaped Message content
}
}
}
MessageRes:
type: |
{
title: MessageRes,
type: object,
properties: {
messages: {
type: string[]
description: |
Array of JSON escaped Message content. Maximum of 5 messages
are returned at a time.
}
},
}
Status:
type: |
{
title: Status,
type: object,
properties: {
code: {
type: string,
description: |
Status code
}
message: {
type: string,
description: |
Message
}
},
}
/message/send-to-clh:
post:
description: Send a message to CLH on the specified connection
body:
application/json:
type: MessageReq
responses:
200:
body:
application/json:
type: Status
500:
body:
application/json:
type: Status
/message/receive-from-clh:
post:
description: Receive messages from CLH on the specified connection
body:
application/json:
type: MessageReq
responses:
200:
body:
application/json:
type: MessageRes
500:
body:
application/json:
type: Status
/sen/receive-from-clh:
post:
description: Receive SEN from CLH on the specified connection
body:
application/json:
type: MessageReq
responses:
200:
body:
application/json:
type: MessageRes
500:
body:
application/json:
type: Status