Zapier int values ​​are sent to Keene as strings

I am using Zapier to POST to Keen stream via webhook, but my values ​​are sent to Keen as strings, eg {"amount": "50"}. Is there a way to get Keen (or Zapier) to overlay "50" as int (50)?

+3


source to share


1 answer


The Zapier "POST" action automatically loops all values ​​to rows, so you'll want to do something completely different. I suggest using the Custom Request action instead of the POST action. This action allows you to specify the raw JSON payload. You can find it if you click "show less common options".

Here's an example request that worked:

Method
POST
URL
https://api.keen.io/3.0/projects/<projID>/events/ScheduledZap2?api_key=<key>
Data
{"first_name": "Steve", "last_name": "Juth", "amount": 59, "state": "NJ"}
Unflatten
yes
Headers

Content-Type
application/json
Optional fields without a value
Data Pass-Through?
Basic Auth

      



Basically, a custom request (POST) to Zapier allows you to customize the JSON string sent to Keen, which allows you to strip off double quotes for int values.

When working with longer lines, say from a text area in an HTML form that is sent to Zap, be careful with newlines, which will break this integration. Zapier provides the ability to replace newlines with spaces using its Formatter by selecting the Text option and replacing [: newline] with [: space].

+3


source







All Articles