Firstly, what a fantastic tool!
I would like to be able to run scenarios from Make rather than from the browser interface.
I’ve seen the API page but could you provide a simple example of what is required?
I am a no-code user!
My name is Ivan Khainatsky, and I am experiencing difficulties with correctly executing a scenario using the U-Xer API. Despite following the available documentation, my attempts to specify the correct agent for scenario execution have been unsuccessful.
Issue Description:
Problem: The scenario consistently runs on the default agent, even though I have specified the correct agent ID in my requests.
Expected Behavior: The scenario should execute using the agent with ID 8be345a8-a0a5-44f9-a32c-9f30bc851e6c, which corresponds to the agent named “Khainatsky” in my U-Xer account.
Steps Taken:
Used the GET method to request scenario execution with the specified agent ID.
Attempted to retrieve a list of agents using various endpoints and methods (GET and POST).
Confirmed that the agent ID is correctly set in my configuration file.
Specific Errors Encountered:
When trying to retrieve the list of agents using GET request: HTTP 405 Method Not Allowed.
When trying to retrieve the list of agents using POST request: HTTP 405 Method Not Allowed.
Request for Assistance:
Correct Endpoint and Method: Could you please confirm the correct API endpoint and method to retrieve the list of agents?
Proper Agent Specification: Is there a different approach or additional parameter required to ensure that the scenario runs on the specified agent “Khainatsky” instead of the default agent?
Documentation Clarification: Any additional documentation or guidance on properly setting up and executing scenarios with a specified agent would be greatly appreciated.
Below is a sample of my current code setup for executing the scenario:
Thank you for your previous response and the helpful video. I followed your suggestion to use the POST /api/Agent/search endpoint to get the list of agents. This worked perfectly, and I was able to retrieve the correct agent IDs.
Here are the details:
Agent Name: Kha*******
Agent ID: 8be345a8-a0a5-****
However, I am still facing an issue with correctly executing a scenario using this specific agent. Despite specifying the correct agent ID in my request, the scenario seems to default to the “Default Agent,” which is inactive in my account.
Current Issue:
When attempting to run the scenario using the specified agent ID, I receive a 405 Method Not Allowed response.
Below is the code snippet I am using for this request:
python
Копіювати код
import requests
import config
def run_scenario(scenario_id, agent_id, token):
headers = {"Authorization": f"Bearer {token}"}
run_url = f"https://gateway.u-xer.com/api/Scenario/{scenario_id}/run"
payload = {"agentId": agent_id}
print(f"Running scenario with agent: {agent_id}")
print(f"Request to URL: {run_url} with payload: {payload}")
run_response = requests.post(run_url, headers=headers, json=payload)
print(f"Status code: {run_response.status_code}")
print(f"Response text: {run_response.text}")
if run_response.status_code == 200:
print("Scenario successfully started")
else:
print(f"Error starting scenario: {run_response.status_code} {run_response.text}")
def main():
token = config.token
if not token:
print("Token not found")
return
print(f"Using agent with ID: {config.agent_id}")
run_scenario(config.scenario_id, config.agent_id, token)
if __name__ == "__main__":
main()
Request for Assistance:
Correct Method: Could you confirm if POST is the correct method to use for executing scenarios with a specified agent?
Endpoint Confirmation: Is there a different endpoint or additional parameters required to ensure the scenario runs with the specified agent “Kha*******” instead of defaulting to “Default Agent”?
405 Error Resolution: Any guidance on resolving the 405 Method Not Allowed error when attempting to run the scenario would be greatly appreciated.
I deeply apologize for the earlier confusion and for taking up your time with questions that turned out to be unnecessary. It was my mistake for not correctly following the available guidance.
I found the information you provided about using the correct API endpoints for running scenarios with specific agents. Specifically, I used the endpoint GET /api/Scenario/{id}/run/agent/{agentid} as you described.
By following this information, I was able to successfully start the scenario with the correct agent. Thank you very much for your help and the detailed instructions you provided.
No idea here, can anyone provide a screenshot of how? thanks!
I seem to get a 401 error after running this so the server must recognize the call but it is not authenticated. My guess is you have to combine auth and scenario run together.
I’d suggest try the API call using uxer swagger first, then postman/hoppscotch(save the request for future use), if both work, then use it on automation platform like make/zapier/n8n.