APIv3 PUT issue 4001 Invalid input
APIv3 PUT issue 4001 Invalid input
Hi, I'm tring to update any data on ASSETS but always failed, what can be wrong?
API key have SDAdmin role, so it's maximum role
#Python version - 3.8
#This script requires requests module installed in python.
import
requests
url
=
"
https://server/api/v3/assets/4"
headers
=
{
"authtoken"
:
"REAL-API-TOKEN"
}
input_data
=
'''{
"asset":{
"department":{
"name": "DepA"
}
}
}'''
data
=
{
'input_data'
:
input_data
}
response
=
requests
.
put
(
url
,
headers
=
headers
,
data
=
data
,
verify
=
False
)
print
(
response
.
text
)
and responce is
{"response_status":{"status_code":4000,"messages":[{"status_code":4001,"field":"department","type":"failed","message":"
Invalid input
"}],"status":"failed"}}
I have checked that 4001 error is
Id or Name given in Input does not exist or not in use or user cannot set the value
Id is OK, i can get info by link:
https://server/api/v3/assets/4?TECHNICIAN_KEY=REALKEY
User can not set the Value? strange... it's maximum rights user.
I did same on different languages, JavaScript, PowerShell, python, but still failed.
Any advice will be helpfull.
SD version is
14201
Topic Participants
Denis
Dinesh Bhaskaran