api-preview-docs icon indicating copy to clipboard operation
api-preview-docs copied to clipboard

Passing environment variables in API v2?

Open glebsonik opened this issue 6 years ago • 0 comments

Is it possible to pass environment variables in JSON body of API v2 call?

Even with pipelines parameters, I want to use environment variables, so I tried to make api v2 call

https://circleci.com/api/v2/project/:vcs-type/:username/:project/pipeline

and tried something like this to send in body:

{
	"branch": "circle_ci_api_v2_test",
	"parameters": 
	{
    	  "my_mystical_param": "Hello from postman mystic",
    	  "my_legendary_param": "Hello from postman legendary"
	},
	"build_parameters":{
	  "envVar": "kuku iopta",
    	  "testVar1": 27
	}
}

But circle ci build does not see any variables. Is there any way to pass them? Beacuse, I think that making assignment env_var_name=parameter_name is not good idea.

glebsonik avatar Sep 27 '19 16:09 glebsonik