Referrer

Use this api to create referrer to use them in the bot link. Using this you can also specify the context parameters. Please refer to the examples below to use it.

Use the _id in the response as the value to use as ref parameter.

Example 1

A sample api to create a referrer with one parameter to send a free text.

curl -XPOST -H "Content-Type: application/json" -H "Authorization:<token>" -d '{"createdById":"api","isDeleted":false,"nm":"Test Referrer","vars":[{"variableIdentifier":{"scope":"FLOW","key":"<id>"},"containsDefaultValue":false,"vTyp":"DOUBLE","value":0}],"aPld":{"val":"sample free text"}}' "http://api.qa.morph.ai:8080/v1/custom/channel"

Json Used

{
    "createdById": "api",
    "isDeleted": false,
    "nm": "Test Referrer",
    "vars": [
        {
            "variableIdentifier": {
                "scope": "FLOW",
                "key": "<id>"
            },
            "containsDefaultValue": false,
            "vTyp": "DOUBLE",
            "value": 0.0
        }
    ],
    "aPld": {
        "val": "sample free text"
    }
}

Response Strucutre

$ curl -XPOST -H "Content-Type: application/json" -H "Authorization:<token>" -d '{"createdById":"api","isDeleted":false,"nm":"Test Referrer","vars":[{"variableIdentifier":{"scope":"FLOW","key":"<id>"},"containsDefaultValue":false,"vTyp":"DOUBLE","value":0}],"aPld":{"val":"sample free text"}}' "http://api.qa.morph.ai:8080/v1/custom/channel"
{"createdTime":1513163596765,"updatedTime":1513163596765,"createdById":"api","updatedById":null,"isDeleted":false,"keyVsCustomFieldValue":null,"tags":null,"_id":"5a310b4cc10e6f4a70932edb","nm":"Test Referrer","vars":[{"id":null,"variableIdentifier":{"scope":"FLOW","key":"<id>"},"customerKey":null,"removeOnError":false,"containsDefaultValue":false,"vTyp":"DOUBLE","value":0.0}],"aPld":{"prms":{},"val":"sample free text"}}

Example 2

A sample api to create a referrer with two parameters to trigger a conversation.

curl -i -XPOST -H "Content-Type: application/json" -H "Authorization:<token>" -d '{"createdById":"api","isDeleted":false,"nm":"Test Referrer","vars":[{"variableIdentifier":{"scope":"FLOW","key":"5a0041cef87f9241e0d9757d"},"value":"its_working","containsDefaultValue":false,"vTyp":"STRING"},{"variableIdentifier":{"scope":"FLOW","key":"<id>"},"containsDefaultValue":false,"vTyp":"DOUBLE","value":0}],"aPld":{"fId":"5a2a512ff87f922655d1efa8"}}' "http://api.qa.morph.ai:8080/v1/custom/channel"

Json Used

{
    "createdById": "api",
    "isDeleted": false,
    "nm": "Test Referrer",
    "vars": [
        {
            "variableIdentifier": {
                "scope": "FLOW",
                "key": "5a0041cef87f9241e0d9757d"
            },
            "value": "its_working",
            "containsDefaultValue": false,
            "vTyp": "STRING"
        },
        {
            "variableIdentifier": {
                "scope": "FLOW",
                "key": "<id>"
            },
            "containsDefaultValue": false,
            "vTyp": "DOUBLE",
            "value": 0.0
        }
    ],
    "aPld": {
        "fId": "5a2a512ff87f922655d1efa8"
    }
}

results matching ""

    No results matching ""