See api-docs Menu

Get Environment Variable

Use this API to return a single Smart Hook Environment Variable.

For more detail on how to use environment variables within a hook function see the Smart Hooks Overview.

Note that because environment variables can be used to store secrets the value will not be returned via this API. You will only the see the name of the Environment Variable.

Resource URL

https://<subdomain>/api/2/hooks/envs/:id

Header Parameters

Authorization

required

string

Set to bearer <access_token>.

Set <access_token> to the access token you generated using the Generate Token API.

The access token must have been generated using an API credential pair created using the scope required to call this API. This API can be called using any one of the following scopes: Manage All.

In order to use Smart Hooks your API Credentials must be created after 21st October 2020.

Resource Parameter

id

required

string

Set to the id of the Hook Environment Variable that you want to fetch.

Sample Responses

{
  "id": "8148095e-1b63-4acc-b2de-ff3fc5f12561",
  "name": "MY_API_KEY",
  "created_at": "2020-08-28T01:10:14.043Z",
  "updated_at": "2020-08-28T01:10:14.043Z"
}

Typically, this error means that your access token value is invalid.

{
    "name": "UnauthorizedError",
    "message": "The request requires user authentication."
}

Response Elements

id A unique identifier for the Hook Environment Variable
name The name of the environment variable.
created_at The ISO8601 formatted date that the environment variable was created.
updated_at The ISO8601 formatted date that the environment variable was last updated.

Postman Collection

Run In Postman

    Clicking Run in Postman button navigates to the page where you can fork the collection to your workspace. Forking the collection into your workspace will enable you to contribute to the source collection using pull requests. You can also view the collection in a public workspace if you like and even import a copy of the collection using the links present on the screen.

Sample Code

cURL

Replace sample values indicated by < > with your actual values.

List Hook Environment Variables

curl 'https://<subdomain>/api/2/hooks/envs/:id' \
-X GET \
-H "Authorization: bearer <access_token>"

Have a Question?

Found a problem or a bug? Submit a support ticket.

Looking for walkthroughs or how-to guides on OneLogin's user and admin features? Check out the documentation in our Knowledge Base.

Have a product idea or request? Share it with us in our Ideas Portal.