How to get environments id?

I'm trying to access this route to get the environment ID, but I'm not having success, could anyone help me?
No description
Solution:
you will need 3 ids for this mutation, environment Id, project Id, and service Id. all three ids can be easily obtained through the command pallet when you have your desired service open - cmd / ctrl + k -> Copy - and you will see an option to copy the ids. ...
Jump to solution
11 Replies
Percy
Percy5mo ago
Project ID: 67325cec-b292-4cb1-a88d-0ac1c6ac5b96
kaiomoreira__
kaiomoreira__OP5mo ago
project ID 67325cec-b292-4cb1-a88d-0ac1c6ac5b96
Brody
Brody5mo ago
id be happy to help but can you tell me your usecase first?
kaiomoreira__
kaiomoreira__OP5mo ago
I will update the refresh token and access token in the railway env So I needed to get the env id of the project I have
Brody
Brody5mo ago
I'm sorry but I don't exactly know what that means, feels like I'm missing some context
kaiomoreira__
kaiomoreira__OP5mo ago
Being objective, I wanted to update information in the variable environment through the API, right?
Brody
Brody5mo ago
okay, can you share your usecase for that as well?
kaiomoreira__
kaiomoreira__OP5mo ago
My use case is to update, but I didn't build it because I wanted to have access to this information I'm telling you. But what I can share and even show is the integration with the delivery API and I need to update the access token for this API in the railway project's env. And I started testing through insomnia, I didn't manage to create the complete use case because I'm validating if I can get this project ID environment variable for me to update.
Brody
Brody5mo ago
okay gotcha, thanks for sharing that. ill get back to you with instructions on how to update a variable for a given service!
kaiomoreira__
kaiomoreira__OP5mo ago
OK
Solution
Brody
Brody5mo ago
you will need 3 ids for this mutation, environment Id, project Id, and service Id. all three ids can be easily obtained through the command pallet when you have your desired service open - cmd / ctrl + k -> Copy - and you will see an option to copy the ids. here is the graphql mutation -
mutation variableCollectionUpsert($input: VariableCollectionUpsertInput!) {
variableCollectionUpsert(input: $input)
}
mutation variableCollectionUpsert($input: VariableCollectionUpsertInput!) {
variableCollectionUpsert(input: $input)
}
and here are the variables needed to go along with that -
{
"input": {
"environmentId": "id_here",
"projectId": "id_here",
"serviceId": "id_here",
"variables": {
"API_KEY": "secret_key_12345"
}
}
}
{
"input": {
"environmentId": "id_here",
"projectId": "id_here",
"serviceId": "id_here",
"variables": {
"API_KEY": "secret_key_12345"
}
}
}
included is an example variable as to show the syntax needed. let me know if you have any issues!
Want results from more Discord servers?
Add your server