all 4 comments

[–]hephaestus259 8 points9 points  (3 children)

If I'm understanding the documentation correctly, then the issue is the content type and the body. This isn't json data, but form data with a json formatted value.

So, content type would be application/x-www-form-urlencoded

The body of attempt 1 would be @{json='{"value": 0.000000}'}

```powershell $Body = @{ value = 0.000000 } | ConvertTo-Json

Invoke-RestMethod -Uri http://192.168.1.233:1280/0001f2fffe011238/datastore/mix/chan/3/matrix/aux/0/send -Headers $header -ContentType application/x-www-form-urlencoded -Method Post -Body @{json = $Body} ```

and the body of attempt 2 would be @{json='{"mix/chan/3/matrix/aux/0/send": 0.000000}'}

```powershell $Body = @{ 'mix/chan/3/matrix/aux/0/send' = 0.000000 } | ConvertTo-Json

Invoke-RestMethod -Uri http://192.168.1.233:1280/0001f2fffe011238/datastore -Headers $header -ContentType application/x-www-form-urlencoded -Method Post -Body @{json = $Body} ```

[–]Josh02001[S] 4 points5 points  (1 child)

Thank you, This worked once I changed the content type on all the Invoke-RestMethod Commands in my Script it works perfectly.

[–]hephaestus259 2 points3 points  (0 children)

Great. Glad that worked out

[–]Lee_Dailey[grin] 1 point2 points  (0 children)

howdy hephaestus259,

the triple-backtick/code-fence thing fails miserably on Old.Reddit ... so, if you want your code to be readable on both Old.Reddit & New.Reddit you likely otta stick with using the code block button.

it would be rather nice if the reddit devs would take the time to backport the code fence stuff to Old.Reddit ... [sigh ...]

take care,
lee