VMware Workspace ONE Community
FranckSartori
Contributor
Contributor

Airwatch REST API : curl for POST

Hi.

I'm able to get the device notes using a command like :

curl -sk -X GET "$APIURL/mdm/devices/notes?searchby=Serialnumber&id=$SERIALNUMBER" -H "$APIAUTHENTICATION" -H "aw-tenant-code: $WK1_APIKEY" -H "accept: application/json;version=1" | $JQ_BINARY -r .DeviceNotes

So the authentication part is OK. Now I'm trying to add a new note with a command like :

curl -sk -X POST "$APIURL/mdm/devices/$DEVICE_ID/notes" -H "$APIAUTHENTICATION" -H "aw-tenant-code: $WK1_APIKEY" -H "accept: application/json" -H "content-type: application/json" --data '{ "Value": "TEST" }'

In this situation, the error message is

{"errorCode":400,"message":"The <Note> tag needs to be of atleast three characters.","activityId":"3ba78857-584d-4d7c-b450-ab31edb630a5"}

I tried many variations without success.

Do you know how to fix this command ? Or an article with a functional example ?

Thanks !

Franck

Labels (1)
Reply
0 Kudos
1 Reply
FranckSartori
Contributor
Contributor

I don't know where I read "Value". It's "Note" obviously.

So :

curl -sk -X POST "$APIURL/mdm/devices/$DEVICE_ID/notes" -H "$APIAUTHENTICATION" -H "aw-tenant-code: $WK1_APIKEY" -H "accept: application/json" -H "content-type: application/json" --data '{ "Note": "TEST" }'

Reply
0 Kudos