Not able to create/read environment variable using management API
I'm trying to create an environment variable using management api:
import { EnvironmentVariables } from '@kinde/management-api-js';
I've set all the scopes related to environment variables in M2M application already. Though whenever I try to read/create environment variable I'm getting below error:
All other management APIs are working fine, only these environment variables related APIs are giving error
Help me why this error is occuring?5 Replies
Hi,
The error you're encountering is a 400 Bad Request with the URL showing
/api/v1/environment_variables/q
, which indicates you're passing an invalid variable_id
parameter.
Looking at your error, the issue appears to be that you're passing 'q'
as the variable_id
, but environment variable IDs should follow a specific format. According to the API documentation, environment variable IDs should look like env_var_0192b1941f125645fa15bf28a662a0b3
.
To get a specific environment variable, you need a valid environment variable ID.
Let me know if this helps, Thanks@Abdiwak - Kinde
Hi, thanks for reply.
But when i try to create one, im getting below error:
In that case, may be your key might be causing issues because:
- It uses hyphens instead of underscores
For your specific case, I recommend:
Stick with UPPER_SNAKE_CASE (underscores only, no hyphens).
Can you check this approach and let me know.
Thanks
Can you check this approach and let me know.
Thanks
Oh yes, that was the issue
Thanks
Glad it works.
Let us know if you encountered any issues. Thanks
Let us know if you encountered any issues. Thanks