下面是一些示例代码,可用于进行Appian WebAPI身份验证:
使用基本身份验证:
import requests
url = "https://exampleappian.com/suite/webapi/endpoint"
username = "integration_user" password = "integration_password"
response = requests.get(url, auth=(username, password)) print(response.text)
使用OAuth 2.0身份验证:
import requests from requests.auth import HTTPBasicAuth
url = "https://exampleappian.com/suite/oauth/access_token"
client_id = "your_client_id" client_secret = "your_client_secret"
response = requests.post(url, auth=HTTPBasicAuth(client_id, client_secret), data={ "grant_type": "client_credentials" }) access_token = response.json()["access_token"] print(access_token)
headers = {"Authorization": f"Bearer {access_token}"} url = "https://exampleappian.com/suite/webapi/endpoint"
response = requests.get(url, headers=headers) print(response.text)
上一篇:AppianRPA进程无法运行
下一篇:Appian字段验证会清除字段值