API Reference

Description

Return a list of environments for a workspace.

GET /v1/metadata/workspace/{workspace_id}/environment

Parameters

ParameterInTypeRequiredDescription
workspace_idpathstringtrueThe ID of the Workspace.

Code Samples

curl -X GET https://h.app.wdesk.com/s/wdata/oc/api/v1/metadata/workspace/{workspace_id}/environment  \ 
-H 'Accept: application/json' \ 
-H 'Authorization: Bearer {access-token}'
http GET https://h.app.wdesk.com/s/wdata/oc/api/v1/metadata/workspace/{workspace_id}/environment  \ 
Accept:application/json \ 
Authorization:"Bearer {access-token}"
wget --method=GET "https://h.app.wdesk.com/s/wdata/oc/api/v1/metadata/workspace/{workspace_id}/environment" \
 --output-document -  \ 
 --header 'Accept: application/json' \ 
 --header 'Authorization: Bearer {access-token}'
import requests
headers = {
  'Accept': 'application/json',
  'Authorization': 'Bearer {access-token}'
}

r = requests.get('https://h.app.wdesk.com/s/wdata/oc/api/v1/metadata/workspace/{workspace_id}/environment', headers = headers)

print(r.json())

Returns

200 - OK

Returns an EnvironmentsResponse containing an array of Environment objects for the provided workspace_id.

Example Responses


{
  "data": [
    {
      "id": "1",
      "name": "Staging Environment",
      "description": "Environment to test changes",
      "position": 0,
      "color": "#3CB702",
      "chains_count": 15,
      "variables": [
        {
          "key": "environment",
          "label": "Environment",
          "defaultValue": "",
          "value": "Testing",
          "encrypted": true
        }
      ],
      "settings": {
        "color": "#3CB702"
      },
      "created_at": "2018-03-14 20:10:39.520585",
      "updated_at": "2018-03-14 20:10:39.520585"
    }
  ]
}