Updating a campaign using the API - Cloud

Talend Cloud Data Stewardship User Guide

Version
Cloud
Language
English
Product
Talend Cloud
Module
Talend Data Stewardship
Content
Administration and Monitoring > Managing users
Data Governance > Assigning tasks
Data Governance > Managing campaigns
Data Governance > Managing data models
Data Quality and Preparation > Handling tasks
Last publication date
2024-01-30

You can update a campaign with the desired modifications. You can only edit the label or the participants.

In this example, Talend API Tester is used to send requests.

For further information about Talend API Tester, see Talend Cloud API Tester User Guide.

Procedure

  1. If you do not have a personal access token yet, generate one. For further information, see Generating a Personal Access Token.
  2. Open Talend API Tester in your browser.
  3. From the Repository tab, select Put in the Method drop-down list.
  4. Enter the following URL: https://tds.{region}.cloud.talend.com/data-stewardship/api/v1/campaigns/owned

    You'll find a list of the URLs to use for each data center in Talend Cloud regions and URLs.

  5. Click the Add header button and enter Authorization in the name field and Bearer followed by a whitespace and your token in the value field.
  6. Click the Add header button and enter Cookie in the name field, then leave the value field empty.
  7. In the Body field, include the body from the POST https://tds.{region}.cloud.talend.com/data-stewardship/api/v1/campaigns/owned operation used to create the campaign, with the desired modifications.

    Example

    To add the steward2@account.com data steward for the New workflow step, add it to the Supervisor value in the participants object:
    {
        "campaign": {
            "name": "my-campaign-resolution-created-via-api",
            "label": "Improve product catalog data quality (created via API)",
            "description": "Increase the level of data quality for each product catalog.",
            "owners": ["owner@account.com"],
            "taskType": "RESOLUTION",
            "schemaRef": {
                "namespace": "org.talend.schema",
                "name": "my_products_created_via_API",
                "version": 1,
                "displayName": "Product (created via API)"
            },
            "taskResolutionDelay": {
                "value": 10,
                "unit": "DAYS"
            },
            "workflow": {
                "name": "default workflow",
                "states": [{
                    "name": "New",
                    "label": "New",
                    "transitions": [{
                        "name": "To validate",
                        "label": "To validate",
                        "targetStateName": "To validate",
                        "allowedRoles": ["Supervisor"]
                    }],
                    "allowedRoles": [],
                    "translations": {}
                }, {
                    "name": "To validate",
                    "label": "To validate",
                    "transitions": [{
                        "name": "Accept",
                        "label": "Accept",
                        "targetStateName": "Resolved",
                        "allowedRoles": ["Validator"]
                    }, {
                        "name": "Reject",
                        "label": "Reject",
                        "targetStateName": "New",
                        "allowedRoles": ["Validator"]
                    }],
                    "allowedRoles": [],
                    "translations": {}
                }, {
                    "name": "Resolved",
                    "label": "Resolved",
                    "transitions": [],
                    "allowedRoles": ["Validator"],
                    "translations": {}
                }]
            }
        },
        "participants": {
            "Supervisor": ["steward1@account.com", "steward2@account.com"],
            "Validator": ["steward1@account.com"]
        }
    }
  8. Click Send.

Results

The API returns a 200 HTTP code to inform you that the request was successful. The response includes an updated JSON description of the campaign.