@Apple I will have to look at those options. Thanks for that. I am curious if it may have to do with Wappler variables? I have set on the Global settings and I am curious if they are not mapping into. I see there is another ENV set here within the post, should I be manually adding the variables again?
You do not need to create them in addition to Globals. The items in Globals will be available in dynamic binding picker for ALL server connect workflows. If you enter something on a workflow itself, it is only shown in the picker for that workflow.
To complement Ken,
It's not necessary, that's just metadata for the Wappler editor, it doesn't change the execution.
My guess is the JSON is not being built correctly, Wappler can be a bit finicky
I appreciate both those replies. So I was able to fix the json body and I tested this inside Postman and received the Token Link. But I switch over to Wappler with the exact settings, coming up with that error of missing the "user": { "client_user_id": "{{dentity}}
which means that environment variable is just not coming through.... hmmm
Here in Post man I enacted the same (but instead of using the {{ variable }}) i just did a random number in replace of that tag and received the Token just fine.
And back in Wappler when I am on the 'Define API Schema' I only get the same result if I manually fill in these input fields that have been set in the json body already that should be pulling in the variables. If I leave these inputs blank and click 'Fetch' more error messages for missing fields.
What if you manually enter a number instead of {{identity}} ?
Also check the network tab, identity has a value?
@franse This is the result of me Loading the 'create_link_token' on mouse click action with a signed-in user. Seems as it isn't getting any of the needed variables.
I added a number matching the correct sign-in users identity instead of the {{identity}} tag and still get this.
In Postman variables are setup the same way and it works just fine.
But what's the result if you test some values here?
Do you know how to preview the server connect on the browser?
@franse The way I tested is just clicking the 'Define API Schema' and if I leave the input field blank, I get the missing fields error.
If I fill in the fields with the real client_id and secret data like this, I indeed get the Token yes. But if I leave blank, missing fields error.
But that's just for defining schema, in order to use it later.
What I'm saying is:
Put some real values there, and check the Server Connect with the button open in browser
:
This is very easy to solve, please re-read the following post:
Using JSON in API Action step has always been finicky with Wappler (you can search the forum for API Action and JSON, you'll find lots of topics), I propose the alternative of using the Group step to build the JSON object.
And also, where {{client_id}} and {{secret_key}} come from?
Maybe you can use a set value with output = true, and bind it to env variables, check if they're declared..
Just for testing, don't forget to delete them once you finish
@Apple I tried out the 'GROUP' variable, unless I have set it up wrong / calling it wrong I am getting the same error.
@franse I have set those up as environment variables. And clicking the thunderbolt icon to link.
I have tested the way you said and clicked the "Open in Browser" and I receive a Token successfully after manually putting the correct details in the json body. It just isn't working any other way for now.
From what I can see here, you don't have any env variable:
For example:
You can add one with right click - variable:
Then you can test the output with set value
:
- Set a name
- Lightning icon
- Select env input
- Output true (remember to disable after testing)
Then:
Like @Apple said before: don't go blind, use set value
to test if you're sending things
@franse I have already GLOBAL environments setup. I am using them already to link things.
Have you done an actual Deploy since adding the ENV variables?
In other words: Add the ENV to inputs, then add the value for those ENV variables in the Server connect settings (with the proper target active), and then deploy.
And deploy?
@Apple I just realized the whole 'Group' Core Action and set it up correctly now as you can see. I have pretty much made it look exactly like the example in Postman I use. So you can see on the Left side is the result I get now, and the one on the right is the one in Postman:
Only thing is I can see the 'IDENTITY' tag is on top, not sure if this would affect it. But I do not see it in the line up to delete. I do see it as a variable to use though:
Now When I click the 'OUTPUT' for the API Connection, Plaid is now telling me that it does not see the information in json format? But hey, it's not saying missing fields anymore thanks you all of your help.
Does this setup look correct? Should I be clearing the JSON Data under API Action Properties. Not sure why I am getting this message when I OUTPUT the API Action.
{ "display_message": null, "documentation_url": "https://plaid.com/docs/?ref=error#invalid-request-errors", "error_code": "INVALID_BODY", "error_message": "body could not be parsed as JSON", "error_type": "INVALID_REQUEST", "request_id": "YdDDMUXoVHs8IhW", "suggested_action": null }
Could you do me a favor and toggle the tree view? It's easier for me:
Also, you should build the object inside a Group step, so the Set Value client_id, client_name, etc. should all go inside a Group step too. This way you can then pass that entire Group to the API Action.
When passing the entire Group to the API Action, you might need to use the JSON encode formatter:
@Apple How do I use the formatter exactly? That may be the thing? And you are saying for all my other 'Set Value''s I should wrap inside a group as well?