Getting 403 error for samsungvd.appControl.launch

I own a Samsung M7 Smart Monitor. I can operate it correctly when I use the samsungvd.appControl process in the commands section of the device on the smartthings advanced page. But when I try to make this request outside of this page, I get a 403 Forbidden error. I think the authentication is working properly. If I remove the Bearer Token definition from the header section, I get a 401 Unauthorized error.

As I try to explain in the examples below, I can run different commands such as samsungvd.remoteControl.
What I want to do is open the YouTube application with a certain video. Sample requests are as follows.

Request Form:


SmartThings Advanced Web Page Api URL: https://my.smartthings.com/advanced/cupcake-api/api/devices/526248d5-xxxx-xxxx-xxxx-xxxxxxxxxxxx/commands

// Request samsungvd.remoteControl:
{"commands":[{"component":"main","capability":"samsungvd.remoteControl","command":"send","arguments":["OK","PRESS_AND_RELEASED"]}]}

// Response samsungvd.remoteControl:
200 OK - {"results":[{"id":"4376d5e3-1d54-4ebb-bdde-ba44d48773c5","status":"COMPLETED"}]}
// Request samsungvd.appControl:
{"commands":[{"component":"main","capability":"samsungvd.appControl","command":"launch","arguments":["111299001912",{"PAYLOAD":"v=nI0RnXGH3-c"},{"requester":"","launchFailAction":"none"}]}]}

// Response samsungvd.appControl:
200 OK - {"results":[{"id":"9bef263f-7517-4bb4-b242-a1b78afd5aaa","status":"COMPLETED"}]}

SmartThings Api URL: https://api.smartthings.com/v1/devices/526248d5-xxxx-xxxx-xxxx-xxxxxxxxxxxx/commands

//Request samsungvd.remoteControl:
{"commands":[{"component":"main","capability":"samsungvd.remoteControl","command":"send","arguments":["OK","PRESS_AND_RELEASED"]}]}

//Response samsungvd.remoteControl:
200 OK - {"results":[{"id":"08c118d9-f77f-435d-8a13-dbb2efe4b405","status":"COMPLETED"}]}
// Request samsungvd.appControl:
{"commands":[{"component":"main","capability":"samsungvd.appControl","command":"launch","arguments":["111299001912",{"PAYLOAD":"v=nI0RnXGH3-c"},{"requester":"","launchFailAction":"none"}]}]}

// Response samsungvd.appControl:
403 Forbidden - Null

Can you help me solve this problem?

Hi @BilalBayrak Welcome to SmartThings Community

There appears to be a problem with the permission, what permission does your personal access token have?

Hi @AlejandroPadilla Thanks for your interest.

That’s actually the first thing I checked. I am sharing the screenshot of the permissions below. I see that it has all permissions.

Let me check. If you try with the SmartThings CLI, do you get the same result?

Hi @AlejandroPadilla I made SmartThings CLI checks as you suggested, let me explain the results.

Firstly https://my.smartthings.com/advanced/devices/526248d5-xxxx-xxxx-xxxx-xxxxxxxxxxxx List of capabilities available at.

But this is the list of accessible capabilities in the SmartThings CLI command.

C:\Users\Bilal> smartthings devices:commands 526248d5-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Smart Monitör

Capabilities:
────────────────────────────────────
 1   ocf
 2   switch
 3   audioVolume
 4   audioMute
 5   tvChannel
 6   mediaInputSource
 7   mediaPlayback
 8   mediaTrackControl
 9   custom.error
 10  custom.picturemode
 11  custom.soundmode
 12  custom.accessibility
 13  custom.launchapp
 14  custom.recording
 15  custom.tvsearch
 16  custom.disabledCapabilities
 17  samsungvd.remoteControl
 18  samsungvd.ambient
 19  samsungvd.ambientContent
 20  samsungvd.mediaInputSource
 21  samsungvd.supportsFeatures
 22  samsungvd.supportsPowerOnByOcf
 23  samsungvd.thingStatus
 24  sec.deviceConnectionState
 25  refresh
 26  execute
────────────────────────────────────

As you can see, the samsungvd.appControl.launch process that I want to run is not supported by SmartThings CLI.

When I send an incomplete request to ensure that this command is supported on the API, it tells me that I need to correct my request and that the arguments section cannot be empty.

Sample Request: https://api.smartthings.com/v1/devices/526248d5-xxxx-xxxx-xxxx-xxxxxxxxxxxx/commands

// Request:
{"commands":[{"component":"main","capability":"samsungvd.appControl","command":"launch"}]}

// Response:
{
    "requestId": "6457413632149508562",
    "error": {
        "code": "ConstraintViolationError",
        "message": "The request is malformed.",
        "details": [
            {
                "code": "SizeError",
                "target": "commands[0].arguments",
                "message": "commands[0].arguments must have a size between 1 and 3.",
                "details": []
            }
        ]
    }
}

I think the technical team of the api service needs to perform a check for this error.

I found a solution that now allows me to at least do what I want, but it is much more challenging.

I created a rule for each of my playlists, with support from the document below. I can then trigger these rules manually.

// To List Rules
GET: "https://api.smartthings.com/rules?locationId={yourLocaitonId}"
// To Create a Rule
POST: "https://api.smartthings.com/rules?locationId={yourLocaitonId}"
// Create Body JSON
{
    "name": "Play the List",
    "actions": [
        {
            "command": {
                "devices": [
                    "{yourDeviceId}"
                ],
                "commands": [
                    {
                        "component": "main",
                        "capability": "samsungvd.appControl",
                        "command": "launch",
                        "arguments": [
                            {
                                "string": "111299001912" // YouTube App ID
                            },
                            {
                                "map": {
                                    "PAYLOAD": {
                                        "string": "list={playListId}" // or v={videoId}
                                    }
                                }
                            }
                        ]
                    }
                ]
            }
        }
    ]
}
// To Delete the Rule
DEL: "https://api.smartthings.com/rules/{yourRuleId}?locationId={yourLocaitonId}"
// To Run the Rule
POST: "https://api.smartthings.com/rules/execute/{yourRuleId}?locationId={yourLocaitonId}"

In this way, I can run the command that I cannot run directly within a rule.
The cons of this are that when I want to open a different video or playlist, I have to create a rule for it first.
Therefore I need the error displayed to be corrected.