Rest command multiple payloads in one command

I am trying to figure out how I can let the first two command work, it only seems to accept the last one

code:

rest_command:
   kleur:
    url: "https://api.smartthings.com/v1/devices/<DeviceID>/commands"
    method: post
    content_type: 'application/json; charset=utf-8'
    headers: 
      Authorization: Bearer <Token>
    payload:
      '[{
          "capability":"samsungce.washerBubbleSoak", "command":"setWasherBubbleSoak", "arguments":["on"],
          "capability":"samsungce.autoDispenseDetergent", "command":"setAmount", "arguments":["standard"],
          "capability":"samsungce.washerCycle", "command":"setWasherCycle", "arguments":["Course_1B"]
      }]'
1 Like

For anyone looking to do this: it’s JSON, so you need to seperate each command with a comma, inside the [] brackets.

Here’s what my payload looks like (I use it to set a sound mode and night mode for my Samsung Soundbar)

payload: |-
      {
        "commands":[
           {
              "component":"main",
              "capability":"execute",
              "command":"execute",
              "arguments":[
                 "/sec/networkaudio/soundmode",
                 {
                    "x.com.samsung.networkaudio.soundmode":"{{sound_mode}}"
                 }
              ]
           }, //<-- here's the comma-separation of the different commands
           {
              "component":"main",
              "capability":"execute",
              "command":"execute",
              "arguments":[
                  "/sec/networkaudio/advancedaudio",
                  {
                    "x.com.samsung.networkaudio.nightmode":{{night_mode}}
                  }
              ]
           }
        ]
      }