Test
projects.task_source.test(strproject_id, TaskSourceTestParams**kwargs) -> TaskSourceTestResponse
POST/projects/{projectId}/task-source/test
Call a task source with the same checks as saving it, without saving it, and return the request sent, the response received and the arrays of objects it holds, to build the mapping from. The mapping is optional here. An omitted authorization uses the stored one. Enterprise only, team admins only.
Parameters
url: str
https URL of the task source. It may contain the placeholders
{user.email}, {user.id} and {project.id}, replaced on each call.
Never put a credential in it: only authorization is stored as a secret.
maxLength4096
Test
import os
from scenario_sdk import Scenario
client = Scenario(
api_key=os.environ.get("SCENARIO_SDK_API_KEY"), # This is the default and can be omitted
api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"), # This is the default and can be omitted
)
response = client.projects.task_source.test(
project_id="projectId",
method="GET",
url="url",
)
print(response.candidates){
"candidates": [
{
"count": 0,
"fields": [
{
"isIdCandidate": true,
"path": "path",
"sample": "sample"
}
],
"tasksPath": "tasksPath"
}
],
"exchange": {
"request": {
"headers": {
"foo": "string"
},
"method": "GET",
"url": "url",
"body": "body"
},
"durationMs": 0,
"response": {
"body": "body",
"headers": {
"foo": "string"
},
"status": 0,
"isBodyTruncated": true
}
},
"tasks": [
{
"id": "id",
"name": "name",
"status": "status"
}
]
}Returns Examples
{
"candidates": [
{
"count": 0,
"fields": [
{
"isIdCandidate": true,
"path": "path",
"sample": "sample"
}
],
"tasksPath": "tasksPath"
}
],
"exchange": {
"request": {
"headers": {
"foo": "string"
},
"method": "GET",
"url": "url",
"body": "body"
},
"durationMs": 0,
"response": {
"body": "body",
"headers": {
"foo": "string"
},
"status": 0,
"isBodyTruncated": true
}
},
"tasks": [
{
"id": "id",
"name": "name",
"status": "status"
}
]
}