I’m using passing a command from Google sheets though Axios to my url.
How would I format this Axios template to incorporate a step with data?
I’ve looked all over and can’t figure it out.
…
Step
(steps.trigger.event.body.Function)
…
Axios Template-
…
import axios from “axios”
Hi @lavellladishmon , thanks for reaching out. Take a look at this example from our docs. You’ll want to pass the data in the data field of the axios request.
@dylan Perfect !!
But I forgot to mention that I’m passing data from
(steps.trigger.event.body)
I can’t seem to find the correct format for that in any of the examples.
@pierce I was able to create the prop but still unable to pass the prop through my post command to my end url. I’m guessing it’s a formatting issue? The prop should be called somewhere under the POST and URL right? (not console logged)
// `data` is the data to be sent as the request body
// Only applicable for request methods 'PUT', 'POST', 'DELETE', and 'PATCH'
// When no `transformRequest` is set, must be of one of the following types:
// - string, plain object, ArrayBuffer, ArrayBufferView, URLSearchParams
// - Browser only: FormData, File, Blob
// - Node only: Stream, Buffer
data: {
firstName: 'Fred'
},
this.email is a string, so you need to pass it as an object:
I’m not totally sure what you’re trying to accomplish with the payload prop. Are you trying to just pass the entire body from the incoming HTTP request to your webhook to Helium?
In your case, you need to make an object containing a payload_raw, port, and confirmed.
It looks like you’ve base64 encoded the payload_raw string, which is good. But you may need to define the other keys in the object that Helium is expecting.
I encourage you to try the HTTP request builder action instead of a Node.js action for your case, it might be easier for you to follow along that Helium’s Postman example for sending a downlink request.