Flow

Notification > Notification Hub > API v1.0 User Guide > Flow

Flow

Create Flow

Request

POST /flow/v1.0/flows
Content-Type: application/json
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: {accessToken}

Request Parameter

Name In Type Required Description
appKey Header String Y Appkey
accessToken Header String Y Authentication Token

Request Body

{
  "flowName": "Flow_Name",
  "description": "Flow_Description",
  "messagePurpose": "NORMAL",
  "steps": {
    "messageChannel": "EMAIL",
    "templateId": "Email_Template_Id",
    "nextSteps": [
      {
        "messageChannel": "ALIMTALK",
        "templateId": "AlimTalk_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "SMS",
            "templateId": "SMS_Template_Id",
            "nextSteps": []
          }
        ]
      }
    ]
  }
}
Name Type Required Description
flowName String Y Flow name
description String N Flow description
messagePurpose String Y Message purpose
NORMAL, AD, AUTH, Authentication
steps Object Y Flow step
steps.messageChannel String Y Message channel
SMS, RCS, ALIMTALK, FRIENDTALK, EMAIL, PUSH
steps.templateId String Y Template ID
steps.nextSteps Object Array N Next step
  • The above example creates a flow that uses an email, alerttalk, and SMS template.
  • Once used, a message channel is not available for the next step.
  • A step can have multiple next steps.
  • Add all message channels to steps, which is only the first step, as you want them to be sent simultaneously, in no particular order.

Response Body

{
  "header": {
    "isSuccessful": true,
    "resultCode": 0,
    "resultMessage": "SUCCESS"
  },
  "flowId": "Flow_Id"
}

Request Example

IntelliJ HTTP
### Create a flow
POST {{endpoint}}/flow/v1.0/flows
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}

{
  "flowName": "Flow_Name",
  "description": "Flow_Description",
  "messagePurpose": "NORMAL",
  "steps": {
    "messageChannel": "EMAIL",
    "templateId": "Email_Template_Id",
    "nextSteps": [
      {
        "messageChannel": "ALIMTALK",
        "templateId": "AlimTalk_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "SMS",
            "templateId": "SMS_Template_Id",
            "nextSteps": []
          }
        ]
      }
    ]
  }
}
cURL
curl -X POST "${ENDPOINT}/flow/v1.0/flows" \
     -H "Content-Type: application/json" \
     -h "x-nc-app-key: ${app_key}" \
     -H "X-NHN-Authorization: ${ACCESS_TOKEN}" \
     -d '{
      "flowName": "Flow_Name",
      "description": "Flow_Description",
      "messagePurpose": "NORMAL",
      "steps": {
        "messageChannel": "EMAIL",
        "templateId": "Email_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "ALIMTALK",
            "templateId": "AlimTalk_Template_Id",
            "nextSteps": [
              {
                "messageChannel": "SMS",
                "templateId": "SMS_Template_Id",
                "nextSteps": []
              }
            ]
          }
        ]
      }'

View Flows

Request

GET /flow/v1.0/flows
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: {accessToken}

Request Parameter

Name In Type Required Description
appKey Header String Y Appkey
accessToken Header String Y Authentication Token
flowId Query String N Flow ID
flowName Query String N Flow name, prefix searchable
limit Query Integer N Views per page
offset Query Integer N Page offset

Request Body

This API does not require a request body.

Response Body

{
  "header": {
    "isSuccessful": true,
    "resultCode": 0,
    "resultMessage": "SUCCESS"
  },
  "flows": [
    {
      "flowId": "Flow_Id",
      "flowName": "Flow_Name",
      "description": "Flow description",
      "messagePurpose": "NORMAL",
      "steps": [
        {
          "messageChannel": "EMAIL",
          "templateId": "Email_Template_Id",
          "nextSteps": [
            {
              "messageChannel": "ALIMTALK",
              "templateId": "AlimTalk_Template_Id",
              "nextSteps": [
                {
                  "messageChannel": "SMS",
                  "templateId": "SMS_Template_Id",
                  "nextSteps": []
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Request Example

IntelliJ HTTP
### View flows
GET {{endpoint}}/flow/v1.0/flows
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
cURL
curl -X GET "${ENDPOINT}/flow/v1.0/flows" \
     -H "Content-Type: application/json" \
     -H "X-NC-APP-KEY: ${APP_KEY}" \
     -H "X-NHN-Authorization: ${ACCESS_TOKEN}"

View a flow

Request

GET /flow/v1.0/flows/{flowId}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: {accessToken}

Request Parameter

Name In Type Required Description
appKey Header String Y Appkey
accessToken Header String Y Authentication Token
flowId Path String Y Flow ID

Request Body

This API does not require a request body.

Response Body

{
  "header": {
    "isSuccessful": true,
    "resultCode": 0,
    "resultMessage": "SUCCESS"
  },
  "flow": {
    "flowId": "Flow_Id",
    "flowName": "Flow_Name",
    "description": "Flow description",
    "messagePurpose": "NORMAL",
    "steps": [
      {
        "messageChannel": "EMAIL",
        "templateId": "Email_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "ALIMTALK",
            "templateId": "AlimTalk_Template_Id",
            "nextSteps": [
              {
                "messageChannel": "SMS",
                "templateId": "SMS_Template_Id",
                "nextSteps": []
              }
            ]
          }
        ]
      }
    ]
  }
}

Request Example

IntelliJ HTTP
### Get Flow
GET {{endpoint}}/flow/v1.0/flows/{{flowId}}
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
cURL
curl -X GET "${ENDPOINT}/flow/v1.0/flows/${FLOW_ID}" \
     -H "Content-Type: application/json" \
     -H "X-NC-APP-KEY: ${APP_KEY}" \
     -H "X-NHN-Authorization: ${ACCESS_TOKEN}"

Modify Flow

Request

PUT /flow/v1.0/flows/{flowId}
Content-Type: application/json
X-NC-APP-KEY: {{ppKey}
X-NHN-Authorization: {accessToken}

Request Parameter

Name In Type Required Description
appKey Header String Y Appkey
accessToken Header String Y Authentication Token
flowId Path String Y Flow ID

Request Body

{
  "flowName": "Flow_Name",
  "description": "Flow_Description",
  "messagePurpose": "NORMAL",
  "steps": {
    "messageChannel": "EMAIL",
    "templateId": "Email_Template_Id",
    "nextSteps": [
      {
        "messageChannel": "ALIMTALK",
        "templateId": "AlimTalk_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "SMS",
            "templateId": "SMS_Template_Id",
            "nextSteps": []
          }
        ]
      }
    ]
  }
}
  • Modifying a flow uses the same request body as creating a flow.

Response Body

{
  "header": {
    "isSuccessful": true,
    "resultCode": 0,
    "resultMessage": "SUCCESS"
  }
}

Request Example

IntelliJ HTTP
### Modify a flow
PUT {{endpoint}}/flow/v1.0/flows/{{flowId}}
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}

{
  "flowName": "Flow_Name",
  "description": "Flow_Description",
  "messagePurpose": "NORMAL",
  "steps": {
    "messageChannel": "EMAIL",
    "templateId": "Email_Template_Id",
    "nextSteps": [
      {
        "messageChannel": "ALIMTALK",
        "templateId": "AlimTalk_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "SMS",
            "templateId": "SMS_Template_Id",
            "nextSteps": []
          }
        ]
      }
    ]
  }
}
cURL
curl -X PUT "${ENDPOINT}/flow/v1.0/flows/${FLOW_ID}" \
     -H "Content-Type: application/json" \
     -h "x-nc-app-key: ${app_key}" \
     -H "X-NHN-Authorization: ${ACCESS_TOKEN}" \
     -d '{
      "flowName": "Flow_Name",
      "description": "Flow_Description",
      "messagePurpose": "NORMAL",
      "steps": {
        "messageChannel": "EMAIL",
        "templateId": "Email_Template_Id",
        "nextSteps": [
          {
            "messageChannel": "ALIMTALK",
            "templateId": "AlimTalk_Template_Id",
            "nextSteps": [
              {
                "messageChannel": "SMS",
                "templateId": "SMS_Template_Id",
                "nextSteps": []
              }
            ]
          }
        ]
      }'
}

Delete Flow

Request

DELETE /flow/v1.0/flows/{flowId}
X-NC-APP-KEY: {appKey}
X-NHN-Authorization: {accessToken}

Request Parameter

Name In Type Required Description
appKey Header String Y Appkey
accessToken Header String Y Authentication Token
flowId Path String Y Flow ID

Request Body

This API does not require a request body.

Response Body

{
  "header": {
    "isSuccessful": true,
    "resultCode": 0,
    "resultMessage": "SUCCESS"
  }
}

Request Example

IntelliJ HTTP
### Delete a flow
DELETE {{endpoint}}/flow/v1.0/flows/{{flowId}}
Content-Type: application/json
X-NC-APP-KEY: {{appKey}}
X-NHN-Authorization: {{authorizationToken}}
cURL
curl -X DELETE "${ENDPOINT}/flow/v1.0/flows/${FLOW_ID}" \
     -H "Content-Type: application/json" \
     -H "X-NC-APP-KEY: ${APP_KEY}" \
     -H "X-NHN-Authorization: ${ACCESS_TOKEN}"
TOP