Environment variable rest api does not appear to work

api

#1

There should be a ReST API category

I can authenticate fine using my api key:

(env) C02PQ6FEG3QD:scf-module-interface chscott$ echo $API_HOST
circleci.REDACTED.com

(env) C02PQ6FEG3QD:scf-module-interface chscott$ curl -X GET --header “Content-Type: application/json” -f “https://${API_HOST}/api/v1.1/me?circle-token=9b33ee7aREDACTED9a04afb5db7”
{
“enrolled_betas” : [ ],
“in_beta_program” : false,
“selected_email” : null,
“avatar_url” : "https://jaxf-github.REDACTED.corp/avatars/u/232?",
“trial_end” : “2016-09-07T22:57:52.011Z”,
“admin” : null,
“basic_email_prefs” : “smart”,
“sign_in_count” : 1,
“github_oauth_scopes” : [ “user:email”, “repo” ],
“analytics_id” : “e2ca0d5b-6d86-4240-80d4-d5ed9f391993”,
“name” : “Charles Scott”,
“gravatar_id” : null,
“days_left_in_trial” : 7,
“parallelism” : 1,
“bitbucket_authorized” : false,
“github_id” : 232,
“dev_admin” : false,
“all_emails” : [ ],
“created_at” : “2016-08-24T22:57:52.011Z”,
“plan” : null,
“heroku_api_key” : null,
“projects” : {
https://jaxf-github.REDACTED.corp/cloud/service-catalog-interface” : {
“on_dashboard” : true,
“emails” : “default”
},
https://jaxf-github.REDACTED.corp/cloud/scf-module-interface” : {
“on_dashboard” : true,
“emails” : “default”
}
},
“login” : “chscott”,
“organization_prefs” : { },
“containers” : 1,
“pusher_id” : “0074989ce94f9d4dae52bd7041b9f7741637b89a”
}

This project exists:

https://circleci.REDACTED.com/gh/cloud/scf-module-interface

How to do I inspect and hopefully set environment vars using restful method?

env) C02PQ6FEG3QD:scf-module-interface chscott$ curl -X GET --header “Content-Type: application/json” -f "https://${API_HOST}/api/v1.1/project/gh/cloud/scf-module-interface?circle-token= 9b33ee7aREDACTED9a04afb5db7"
curl: (22) The requested URL returned error: 404 Not Found

(env) C02PQ6FEG3QD:scf-module-interface chscott$ curl -X GET --header “Content-Type: application/json” -f "https://${API_HOST}/api/v1.1/project/gh/cloud/scf-module-interface/envvar?circle-token= 9b33ee7aREDACTED9a04afb5db7"
curl: (22) The requested URL returned error: 404 Not Found

Am I interpreting your documentation https://circleci.com/docs/api/#list-environment-variables incorrectly?

I’ve also tried setting an api token using “all” scope for the specific project and using that token as opposed to my own token, same result.

Thanks,

Chuck


Create environment variable via API
#2

The docs on Parameterized builds should help here: https://circleci.com/docs/parameterized-builds/


#3