Best answer

Passing Params in defined format via JSON

  • 28 March 2021
  • 8 replies
  • 930 views

Userlevel 2
Badge

The issue I am hitting I beleive comes down to the fact that the App I am hitting expects the data to define ‘user’.

I have no issues sending the info from Zapier when I hardcode the payload as defined below.

{

"membershipId": `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx`,

"user": {

"email": "urna@example.com",

"name": "Urna Semper",

"tz": "Europe/Paris"

}

}

The issue comes when I leverage the Input Data. The App I am sending to expects it in the format above. 

Code Example 

The test hits the App successfully… it just doesn’t do anything as it is expecting those three data elements defined as ‘user’. 

icon

Best answer by Troy Tessalone 29 March 2021, 04:58

View original

8 replies

Userlevel 2
Badge

I actually just figured it out. I tried what you suggested and there was no way to get it to return anything but 

Then I did a little more digging and it actually works better with he Python. I am going to try to make it work with the Webhook… but Bam I not only got it to work, but I found an issue with their API. 

See Example

 

Userlevel 7
Badge +14

Hi @Digital 

Try using the Webhooks app instead of a Code step: https://zapier.com/apps/webhook/integrations#triggers-and-actions

 

Userlevel 2
Badge

Thanks Troy… this gets me almost there. The only thing I can’t figure out is how to get the elements of the user data passed as ‘user’. I’ve tried a couple of different things and can’t seem to close the gap. Any thoughts there? I read the documentation but must be missing something. 

Userlevel 7
Badge +14

@Digital 

Try like this:

 

Userlevel 2
Badge

 

@Troy Tessalone That definitely helped me. I didn’t even know you can do that. :slight_smile: That said. It didn’t work, but it did lead me to figuring out that I can have all three parameters. I am not getting the successful result as expected… but I am so close. It actually works the same in both Webhooks and Python code. See examples below… there is just something I’m missing. 

THE PYTHON METHOD:

THE RESULT :

 

THE WEBHOOK METHOD:

THE WEBHOOK RESULT:

 

Userlevel 7
Badge +14

@Digital 

For the User object, each value needs a preceding parameter.

So in the example below just replace the 3 values on the right side of each :

 

Userlevel 2
Badge

That is hardcoding it. It needs to be dynamic. The example is… every time a new customer buys a subscription, I pass that person’s data on to the third-party App to give them access. Make sense? 

Userlevel 7
Badge +14

@Digital 

You can dynamically replace the value for each parameter.

For email, dynamically insert the email address. (“email”: “[EMAIL]”)

For name, dynamically insert the name. (“name”: “[NAME]”)

For tz, dynamically insert the time zone. (“tz”: “[TZ]”)

 

Reply