Forum Discussion
For anybody interested in knowing how to call a SnapLogic public API using Python:
import requests
from requests.auth import HTTPBasicAuth
snaplogic_user = "user@user.com"
snaplogic_password = "SuperCoolPassword"
url = "https://elastic.snaplogic.com/api/1/rest/public/runtime/<YourOrg>"
auth = HTTPBasicAuth(snaplogic_user, snaplogic_password)
response = requests.get(url, auth=auth)
You’ll definitely want to retrieve your username and password securely, but the gist is the same.
- SpiroTaleski4 years agoValued Contributor
Per my opinion, having a separate pipeline that will be dedicated only for handling and processing the async responses is better and simpler approach. Inside the pipeline you will need to apply a logic for handling/receiving and processing the incoming messages(async responses). That pipeline can be exposed as an REST API, by creating the triggered task for that pipeline. You don’t need to create any additional/external API’s. Once you create triggered task, the pipeline will have REST endpoint and basic or token authentication, and can be invoked from the external systems.
Triggered Tasks: https://docs-snaplogic.atlassian.net/wiki/spaces/SD/pages/1438189/Triggered+Tasks
Regards,
Spiro Taleski