Platform Api

Tasks

getTask

Retrieve details of an asynchronous task

Returns the details of an asynchronous task, including its status and result if completed.


/platform/tasks/{id}

Usage and SDK Samples

curl -X GET \
 \
 -H "Accept: application/json" \
 "https://uknapiproxy.coreview.com/public/platform/tasks/{id}?api-version=apiVersion_example"
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.TasksApi;

import java.io.File;
import java.util.*;

public class TasksApiExample {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();

        // Configure OAuth2 access token for authorization: oauth2
        OAuth oauth2 = (OAuth) defaultClient.getAuthentication("oauth2");
        oauth2.setAccessToken("YOUR ACCESS TOKEN");

        // Create an instance of the API class
        TasksApi apiInstance = new TasksApi();
        String id = id_example; // String | The unique identifier for the task
        String apiVersion = apiVersion_example; // String | 

        try {
            AsyncTaskDetail result = apiInstance.getTask(id, apiVersion);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TasksApi#getTask");
            e.printStackTrace();
        }
    }
}
import 'package:openapi/api.dart';

final api_instance = DefaultApi();

final String id = new String(); // String | The unique identifier for the task
final String apiVersion = new String(); // String | 

try {
    final result = await api_instance.getTask(id, apiVersion);
    print(result);
} catch (e) {
    print('Exception when calling DefaultApi->getTask: $e\n');
}

import org.openapitools.client.api.TasksApi;

public class TasksApiExample {
    public static void main(String[] args) {
        TasksApi apiInstance = new TasksApi();
        String id = id_example; // String | The unique identifier for the task
        String apiVersion = apiVersion_example; // String | 

        try {
            AsyncTaskDetail result = apiInstance.getTask(id, apiVersion);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling TasksApi#getTask");
            e.printStackTrace();
        }
    }
}
Configuration *apiConfig = [Configuration sharedConfig];

// Configure OAuth2 access token for authorization: (authentication scheme: oauth2)
[apiConfig setAccessToken:@"YOUR_ACCESS_TOKEN"];


// Create an instance of the API class
TasksApi *apiInstance = [[TasksApi alloc] init];
String *id = id_example; // The unique identifier for the task (default to null)
String *apiVersion = apiVersion_example; //  (default to null)

// Retrieve details of an asynchronous task
[apiInstance getTaskWith:id
    apiVersion:apiVersion
              completionHandler: ^(AsyncTaskDetail output, NSError* error) {
    if (output) {
        NSLog(@"%@", output);
    }
    if (error) {
        NSLog(@"Error: %@", error);
    }
}];
var PlatformApi = require('platform_api');
var defaultClient = PlatformApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: oauth2
var oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = "YOUR ACCESS TOKEN";

// Create an instance of the API class
var api = new PlatformApi.TasksApi()
var id = id_example; // {String} The unique identifier for the task
var apiVersion = apiVersion_example; // {String} 

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.getTask(id, apiVersion, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class getTaskExample
    {
        public void main()
        {
            // Configure OAuth2 access token for authorization: oauth2
            Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

            // Create an instance of the API class
            var apiInstance = new TasksApi();
            var id = id_example;  // String | The unique identifier for the task (default to null)
            var apiVersion = apiVersion_example;  // String |  (default to null)

            try {
                // Retrieve details of an asynchronous task
                AsyncTaskDetail result = apiInstance.getTask(id, apiVersion);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling TasksApi.getTask: " + e.Message );
            }
        }
    }
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure OAuth2 access token for authorization: oauth2
OpenAPITools\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');

// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\TasksApi();
$id = id_example; // String | The unique identifier for the task
$apiVersion = apiVersion_example; // String | 

try {
    $result = $api_instance->getTask($id, $apiVersion);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TasksApi->getTask: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::TasksApi;

# Configure OAuth2 access token for authorization: oauth2
$WWW::OPenAPIClient::Configuration::access_token = 'YOUR_ACCESS_TOKEN';

# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::TasksApi->new();
my $id = id_example; # String | The unique identifier for the task
my $apiVersion = apiVersion_example; # String | 

eval {
    my $result = $api_instance->getTask(id => $id, apiVersion => $apiVersion);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling TasksApi->getTask: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: oauth2
openapi_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Create an instance of the API class
api_instance = openapi_client.TasksApi()
id = id_example # String | The unique identifier for the task (default to null)
apiVersion = apiVersion_example # String |  (default to null)

try:
    # Retrieve details of an asynchronous task
    api_response = api_instance.get_task(id, apiVersion)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling TasksApi->getTask: %s\n" % e)
extern crate TasksApi;

pub fn main() {
    let id = id_example; // String
    let apiVersion = apiVersion_example; // String

    let mut context = TasksApi::Context::default();
    let result = client.getTask(id, apiVersion, &context).wait();

    println!("{:?}", result);
}

Scopes

Parameters

Path parameters
Name Description
id*
String
The unique identifier for the task
Required
Query parameters
Name Description
api-version*
String
Required

Responses