Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
REST API for Crestron Virtual Control
#simplsharppro
G'day all,
Has anyone successfully added or modified a program file on a VC4 using curl and the REST API from a command line? I've tried but have been unable to make it work. I can query the existing programs using the following; curl -k -X GET "http://10.0.0.222/VirtualControl/config/api/ProgramLibrary" -H "accept: application/json" -H "Authorization: [#####]"
I can't work out how to send the program file. When I try to send the following; curl -k -X PUT "http://10.0.0.222/VirtualControl/config/api/ProgramLibrary" -d {"ProgramId":23,"AppFile":"D:\CrestronCode\Code\bin\Debug\test.cpz"} -H "accept: application/json" -H "Authorization: [#####]"
I receive the following message. {
"Actions": [
{
"Operation": "set partial",
"Results": [
{
"path": "Device.Programs.ProgramLibrary",
"object": "NULL",
"StatusInfo": "ProgramId: Missing required parameter in the JSON body or the post body or the query string",
"StatusId": 6
}
],
"TargetObject": "ProgramLibrary",
"Version": "2.0.1"
}
]
}
?
Thanks in advance. |
The example shown in the API docs is a POST request with multipart form data, so I would start with that:? I don't see an example of actually uploading a file though, just pointing to an existing one. On Mon, Oct 17, 2022 at 1:00 AM <matthew.taylor@...> wrote:
|
I have this working inPowerShell with the following for anyone who's interested.
$file = "D:\file\path\VTProFile.cpz"
$ip = "10.0.0.222"
$ProgramId = 23
$Token = "#####"
$Authorization = "Authorization: $Token"
?
curl.exe -X PUT -H $Authorization -F StartNow=true -F AppFile=@$file -F ProgramId=$ProgramId Mush |
to navigate to use esc to dismiss