Commands client

The Commands client can be used to execute commands that are publicly registered in Content Hub.

Namespace

Command name

Arguments

external.action

external.action

RequestResponse
new JObject(
    new JProperty("entity_id", <ENTITY_ID>),
    new JProperty("action_id", <ACTION_ID>),
    new JProperty("properties", new JArray()),
    new JProperty("relations", new JArray()),
    new JProperty("action_execution_source", "ExternalAction"),
    new JProperty("extra_data", new JObject())

m.security

applyuserrole

RequestResponse
new JObject(
   new JProperty("user_id", <USER_ID>),
   new JProperty("role", <ROLE>),
   new JProperty("target_id",  <TARGET_ID>))

m.security

updateuserroles

RequestResponse
new JObject(
    new JProperty("role",  <ROLE>),
    new JProperty("target_id", <TARGET_ID>),
    new JProperty("added_users", new JArray()),
    new JProperty("removed_users", new JArray()))

m.asset

setmaster

RequestResponse
new JObject(
    new JProperty("new_master_id", <NEW_MASTER_ID>),
    new JProperty("entity_id", <ENTITY_ID>),
    new JProperty("master_relation", <MASTER_RELATION>))

m.asset

tag.with.ai

RequestResponse
new JObject(
    new JProperty("aiProfileIdentifier", <AI_PROFILE_IDENTIFIER>),
    new JProperty("entityId", <ENTITY_ID>))

m.asset

complete.ai.tagging

RequestResponse
new JObject(
    new JProperty("entityId", <ENTITY_ID>))

m.asset

discard.ai.tagging

RequestResponse
new JObject(
    new JProperty("entityId", <ENTITY_ID>))   

m.security

removeuserrole

RequestResponse
new JObject(
    new JProperty("user_id", <USER_ID>),
    new JProperty("role", <ROLE>),
    new JProperty("target_id", <TARGET_ID>))

m.security

applyusergrouprole

RequestResponse
new JObject(
    new JProperty("usergroup_id", <USERGROUP_ID>),
    new JProperty("role", <ROLE>),
    new JProperty("target_id", <TARGET_ID>))

m.security

removeusergrouprole

RequestResponse
new JObject(
    new JProperty("usergroup_id", <USERGROUP_ID>),
    new JProperty("role", <ROLE>),
    new JProperty("target_id", <TARGET_ID>))

stateflow

assign.stateflow

RequestResponse
new JObject(
    new JProperty("state_flow_id", <STATE_FLOW_ID>),
    new JProperty("target_id", <TARGET_ID>),
    new JProperty("initial_state_id", <INITIAL_STATE_ID>))

stateflow

apply.state

RequestResponse
await MClient.Commands.ExecuteCommandAsync("automation", "apply.state", new JObject
{
    new JProperty("target_id", 111),
    new JProperty("route_id", 999)
});

To run an asynchronous command through the SDK:

RequestResponse
await MClient.Commands.ExecuteCommandAsync(<NAMESPACE>, <NAME>, <ARGS>);

Do you have some feedback for us?

If you have suggestions for improving this article,