macg Posted July 4, 2018 Share Posted July 4, 2018 I read all the documentation about environment variables, but I still fail to solve my problem. I created a Workflow Environment Variable with the name "API_KEY", added the key as value and checked Don't Export. Next, I created a "Run Script" action (/bin/bash, with input as argv, running instances sequentially) that looks pretty much like this but unfortunately doesn't work. Seems like I use $API_KEY incorrectly because if I replace $API_KEY with the key itself, it works. curl -H 'Authorization: Fooapp-authtoken $API_KEY' https://fooapp.com/api/contacts Hope somebody can clarify, what I'm doing wrong. Thanks Link to comment
Tsunami Posted July 4, 2018 Share Posted July 4, 2018 (edited) Variables aren't evaluated inside single quotes. Try double quotes: curl -H "Authorization: Fooapp-authtoken $API_KEY" https://fooapp.com/api/contacts Edited July 4, 2018 by Tsunami Link to comment
macg Posted July 4, 2018 Author Share Posted July 4, 2018 Haha, I had a hunch that might be it. Thanks a lot, it works now ? Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now