Import a chain#

Description#

Takes a .chain file and imports it into the provided environment. Returns chain metadata for the imported chain.

Note: .chain export files will automatically expire and become unusable after 14 days. Expired .chain files remain on the exported system until removed manually.

POST /v1/environments/{environment_id}/import_chain

Parameters#

Parameter

In

Type

Required

Description

environment_id

path

string

true

The ID of the Environment.

wk-target-workspace

header

string

false

The wk-target-workspace header is only required for requests made by a service provider application. This does not apply to the majority of Workiva Chains API users. This header specifies the ID of the target workspace on which the service provider application wishes to take action. This workspace must be managed by the service provider.

file

body

string(binary)

false

Must be a .chain file.

Detailed descriptions#

wk-target-workspace: The wk-target-workspace header is only required for requests made by a service provider application. This does not apply to the majority of Workiva Chains API users. This header specifies the ID of the target workspace on which the service provider application wishes to take action. This workspace must be managed by the service provider.

Body parameter example#

file: string

Code Samples#

curl -X POST https://h.app.wdesk.com/s/wdata/oc/api/v1/environments/{environment_id}/import_chain \
    -H 'Content-Type: multipart/form-data' \
    -H 'Accept: application/json' \
    -H 'wk-target-workspace: string' \
    -H 'Authorization: Bearer {access-token}'
http POST https://h.app.wdesk.com/s/wdata/oc/api/v1/environments/{environment_id}/import_chain \
    Content-Type:multipart/form-data \
    Accept:application/json \
    wk-target-workspace:string \
    Authorization:"Bearer {access-token}"
wget --method=POST "https://h.app.wdesk.com/s/wdata/oc/api/v1/environments/{environment_id}/import_chain" \
    --output-document -  \ 
    --header 'Content-Type: multipart/form-data' \ 
    --header 'Accept: application/json' \ 
    --header 'wk-target-workspace: string' \ 
    --header 'Authorization: Bearer {access-token}'
import requests

headers = {
  'Content-Type': 'multipart/form-data',
  'Accept': 'application/json',
  'wk-target-workspace': 'string',
  'Authorization': 'Bearer {access-token}'
}

r = requests.post('https://h.app.wdesk.com/s/wdata/oc/api/v1/environments/{environment_id}/import_chain', headers = headers)

print(r.json())

print(r.json())

Returns#

200 - OK#

Returns a ChainResponse containing the newly imported Chain.

201 - Created. The chain was successfully imported into the environment, but the underlying service failed to get the chain metadata.#

Returns a ChainResponse containing a CreatedWithErrorResponse.

Example Responses#

{
  "data": {
    "id": "1",
    "internal_id": 0,
    "name": "List File Content -- Import",
    "description": "",
    "created_at": "2018-03-14 20:10:39.520585",
    "updated_at": "2018-03-14 20:10:39.520585",
    "disabled": true,
    "concurrency_enabled": false,
    "runtime_inputs": [
      {
        "vuid": "data.chain.45072337-72ee-4c52-9428-0b2ae21ac73c",
        "data_type": "string"
      }
    ],
    "schedules": [
      {
        "enabled": true,
        "start_at": "2019-02-08 06:25:00",
        "end_at": "2019-02-08 06:25:00",
        "properties": {
          "days_of_month": [
            "15",
            "30"
          ],
          "days_of_week": [],
          "recurring_interval": 1,
          "recurring_type": "monthly",
          "run_at_hours": 10,
          "run_at_minutes": 1,
          "run_at_seconds": 0,
          "stop_at_hours": null,
          "stop_at_minutes": null,
          "zone": "America/New_York"
        }
      }
    ]
  }
}
{
  "data": {
    "message": "Operation succeeded, but an additional request failed. A location header with the resource URL is provided.",
    "id": "1",
    "url": "https://{api-root}/v1/metadata/environment/{environment_id}/chain/{chain_id}"
  }
}
No example available