Question

How to use event's parameter on REST API payload


We have the following payload and would like to use the event’s parameter {{TRIGGERED_ON}} on the “timestamp” key.

{
"something": [
{
"akey": "avalue",
"type": 0,
"points": [
{
"timestamp": 1234567890,
"value": 0.1
}
]
}
]
}

 


7 replies

Userlevel 3
Badge

Seems like a good use case for the Expression Evaluator processor. It can modify the record’s field on the data in motion.  

This is needed to be done on the “Subscription” section of Control Hub as a webhook payload

Userlevel 3
Badge

Ah, got it. Our docs have some examples about doing things like that. 

Using the parameters as string has no issue, the timestamp needs to be sent as number, and so the curly brackets for the parameter conflict with JSON formatting.

Userlevel 3
Badge

Not sure I follow as the examples include sending a JSON payload. What error are you seeing?

HTTP 400 Bad Request error.

Tried with the following and also wrapping {{TRIGGERED_ON}} with double quotes

{
"something": [
{
"akey": "avalue",
"type": 0,
"points": [
{
"timestamp": {{TRIGGERED_ON}},
"value": 0.1
}
]
}
]
}

 

Userlevel 3
Badge

Can you take a screenshot of the whole subscription configuration screen? Be sure to blur out any sensitive info. 

Reply