[Fixed in 2.6.0] Issue with 2.5.1 and API Jobs Post
Posted: Mon Oct 21, 2024 5:10 pm
I've authorized the api/v3/swagger-ui/ to test with, trying to run /api/v3/jobs/push using the Try It Out! function:
curl:
curl -X 'POST' \
'https://servernamehere/api/v3/jobs/push' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.UsjHT8jUtfOVFYW-YhO3w_hCBrKpmSzXSk8RjilhNn0' \
-H 'Content-Type: application/json' \
-d '{
"commands": "[show version]",
"requireEnableMode": true,
"requireConfigureMode": true,
"deviceUuids": "[D-f3918eae-e52a-400e-a4c4-3b24d9e8c1f3, D-63efb992-869a-4893-b49b-c17be4e17d5b]",
"tagUuids": "[c277fa8-1790-4184-9e3a-c277fa881289]",
"advancedSettings": {
"promptMatchingModeEnum": "LEARNING",
"overrideTimeouts": true,
"timeout": 60000,
"overrideCredentials": true,
"username": "username",
"password": "password",
"enablePassword": "string",
"configurePassword": "string"
}
}'
Response:
Error 400:
{
"errorCode": "INVALID",
"details": [
"Unable to convert JSON to request object, most likely type mismatch"
]
}
I've attempted replacing the deviceUUID fields and tagUUID fields with known good, but always receive the same conversion error.
Any ideas? Would love to start using this feature.
curl:
curl -X 'POST' \
'https://servernamehere/api/v3/jobs/push' \
-H 'accept: application/json' \
-H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJhdXRoMCJ9.UsjHT8jUtfOVFYW-YhO3w_hCBrKpmSzXSk8RjilhNn0' \
-H 'Content-Type: application/json' \
-d '{
"commands": "[show version]",
"requireEnableMode": true,
"requireConfigureMode": true,
"deviceUuids": "[D-f3918eae-e52a-400e-a4c4-3b24d9e8c1f3, D-63efb992-869a-4893-b49b-c17be4e17d5b]",
"tagUuids": "[c277fa8-1790-4184-9e3a-c277fa881289]",
"advancedSettings": {
"promptMatchingModeEnum": "LEARNING",
"overrideTimeouts": true,
"timeout": 60000,
"overrideCredentials": true,
"username": "username",
"password": "password",
"enablePassword": "string",
"configurePassword": "string"
}
}'
Response:
Error 400:
{
"errorCode": "INVALID",
"details": [
"Unable to convert JSON to request object, most likely type mismatch"
]
}
I've attempted replacing the deviceUUID fields and tagUUID fields with known good, but always receive the same conversion error.
Any ideas? Would love to start using this feature.