According to Wed. 23th Jun. 2021 meeting, I submitted two commits in this pull request as following:
Add constrain to initial_salt, message, and purpose parameters.
initial_salt string parameter from request and message API size must be larger or equals to 24 characters. (config.saltStrLength, configurable variable like config.saltLength)
message string parameter from message API size must be less or equals to 1024 characters. (configurable variable via config.messageStrLength)
purpose string parameter from message API size must be less or equals to 512 characters. (configurable variable via config.purposeStrLength)
Add new three error types, INITIAL_SALT_TOO_SHORT (20083), MESSAGE_TOO_LONG (20084), and PURPOSE_TOO_LONG (20085), to handle the error that could occur by sending the parameters.
Add callback calls after sent data to TM.
Add a new required parameter, callback_url, to message API.
POST /rp/message/:referenceID (since I reached the maximum number to create APIs for a free account, I will attached it as codes)
openapi: 3.0.0
servers:
- url: 'https://virtserver.swaggerhub.com/ndid/rp_callback/0.1'
info:
version: "4.0"
title: RP Message Callback API
description: API that RP MUST IMPLEMENT to be called by the platform
paths:
'/rp/message/{reference_id}':
post:
summary: Update from NDID
description: 'Update from NDID to RP, there''s been an update to the status. Note that {reference_id} is NOT automatically append to the registered callback url. This is just an example that you can register callback with reference_id as parameter'
operationId: request_update
parameters:
- name: reference_id
in: path
description: Reference ID
required: true
schema:
type: string
responses:
'204':
description: Status Update Acknowledged
requestBody:
content:
application/json:
schema:
oneOf:
- $ref: '#/components/schemas/CallbackCreateMessageResult'
description: Callback about message
required: true
components:
schemas:
CallbackCreateMessageResult:
type: object
required:
- node_id
- type
- reference_id
- message_id
- success
properties:
node_id:
type: string
type:
type: string
enum:
- create_message_result
reference_id:
type: string
message_id:
type: string
creation_block_height:
type: string
description: '<CHAIN_ID>:<BLOCK_HEIGHT>'
success:
type: boolean
error:
$ref: '#/components/schemas/Error'
Error:
type: object
required:
- code
- message
properties:
code:
type: integer
message:
type: string
According to Wed. 23th Jun. 2021 meeting, I submitted two commits in this pull request as following:
message string parameter from message API size must be less or equals to 1024 characters. (configurable variable via config.messageStrLength)
purpose string parameter from message API size must be less or equals to 512 characters. (configurable variable via config.purposeStrLength)
Add new three error types, INITIAL_SALT_TOO_SHORT (20083), MESSAGE_TOO_LONG (20084), and PURPOSE_TOO_LONG (20085), to handle the error that could occur by sending the parameters.
Add a new required parameter, callback_url, to message API.
Add callback calls after sent Message to TM.
You can find message swagger format APIs here: