Skip to main content

No project description provided

Project description

Python Functions for Alteryx Workflow Management

This document explains two Python functions designed to manage Alteryx workflows through their API:

1. generate_oauth_token(certificate_location, access_token_url, username, password, print_access_token):

This function acquires an OAuth 2.0 access token necessary for interacting with the Alteryx API.

Parameters:

  1. certificate_location (str): Path to the certificate file used for verifying the API endpoint.
  2. access_token_url (str): URL for obtaining the access token.
  3. username (str): Username for authentication.
  4. password (str): Password for authentication.
  5. print_access_token (bool): Set to True to print the obtained access token.

Return Value:

str: The access token on successful retrieval, otherwise None.

2. trigger_alteryx_workflow(certificate_location, access_token_url, url, username, password, print_access_token)

This function triggers an Alteryx workflow using the obtained access token.

Parameters:

  1. certificate_location (str): Path to the certificate file used for verifying the API endpoint.
  2. access_token_url (str): URL for obtaining the access token.
  3. url (str): URL of the Alteryx workflow endpoint to trigger.
  4. username (str): Username for authentication.
  5. password (str): Password for authentication.
  6. print_access_token (bool): Set to True to print the obtained access token.

Return Value:

int: HTTP status code of the trigger request. 200 indicates successful workflow triggering.

Example Usage:

# Replace with your specific values
certificate_location = "path/to/certificate.pem"
access_token_url = "https://your-alteryx-server/oauth2/token"
url = "https://your-alteryx-server/api/workflows/123/run"
username = "your_username"
password = "your_password"
print_access_token = True

# Obtain access token
access_token = generate_oauth_token(certificate_location, access_token_url, username, password, print_access_token)

# Trigger workflow
status_code = trigger_alteryx_workflow(certificate_location, access_token_url, url, username, password, print_access_token)

if status_code == 200:
  print("Workflow triggered successfully!")
else:
  print(f"Error triggering workflow: {status_code}")

Additional Notes:

  1. Ensure you have the requests and json libraries installed (pip install requests json).
  2. Replace the placeholder values with your actual Alteryx configuration details.
  3. This example demonstrates basic usage. Error handling and more robust implementation might be required in production environments.

I hope this README clarifies the usage of these functions for managing Alteryx workflows through Python. Feel free to ask if you have any further questions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

AlteryxConnector-0.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file AlteryxConnector-0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for AlteryxConnector-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1453a2ea1b04a16865ae07b05b2644504111d8e86c39e2d2fa895429c2e62e4b
MD5 c8146469362b1fb0920f339c9f5a936d
BLAKE2b-256 545a54064d61f9a207a8b8e1b97c021403f6d140334b2abb7f1a154cdfd17901

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page