Execute Scheduled Task - Sellercloud API Docs

Overview

This endpoint is used to trigger the execution of a single existing Scheduled Task. To consume it, you must be an Authenticated User. Once you have obtained a valid token, it must be passed on the call.

Endpoint

An example of this endpoint for server XX is:

​​https:// xx.api.sellercloud.com/rest/api/ScheduledTasks/{id}/ExecuteTask​

For your server, the endpoint will be:

https:// {your_server_id}.api.sellercloud.com/rest/api/ScheduledTasks/{id}/ExecuteTask

Request

Parameter Data Type Description Is Required
id integer The ID of an existing Scheduled Task. Yes

Response

Example Response

{
  "QueuedJobLink": "string",
  "ID": 0,
  "Message": "string"
}

Demo in C#

static async Task Main(string[] args)
{
    await GetExecutionHistory();
}
static async Task GetExecutionHistory()
{
    // Valid ID of a scheduled task can be found through Delta UI
    int taskID = 28142;

// URL for downloading execution history
    string url = $"http://tt.cwa.sellercloud.com/rest/api/ScheduledTasks/{taskID}/ExecuteTask";

// Valid token must be provided here
    string token = "test token";

using (HttpClient client = new HttpClient())
    {
        client.DefaultRequestHeaders.Authorization =
            new AuthenticationHeaderValue("Bearer", token);
        HttpResponseMessage responseMessage = await client.GetAsync(url);

var content = responseMessage.Content;
    }
}
public class QueuedJobResponse
{
    public string QueuedJobLink { get; set; }
    public int ID { get; set; }
}