Skip to Content

Your First Task

In this step we will:

  1. Create a Queue
  2. Create a Virtual User Token
  3. Create a Task
  4. Check the task in our dashboard
  5. Cancel our mock task in our dashboard

Don’t worry each step is quite simple takes 10 seconds, max 1 minute.

Let’s Begin

First you need account for your organization. We will use bricky as an example. You must use different name.

Navigate to app.qrambo.io and create a new organization.

After creating your organization, you will be redirected to the dashboard. Let’s begin the tutorial.

Creating a Queue

  1. Open your dashboard and change environment to dev. 2. Click on Create Queue button. and give your queue a name as my_first_queue.

Queues are containers for tasks, so you have to create a new queue. For more information about queues, please read Queues.

Creating a Virtual User Token

  1. Click on Create new virtual user button.

  2. Create API key for your agent for dev environment.

  3. Copy API key

Conventionaly, you need a API-Token to communicate any API, however Qrambo don’t have a global API token. You have to create a Virtual User (Agent, Robot, etc.) to get API key for this user and use it to communicate with Qrambo.

Creating a Task

You will create a task in your backend, in this step we use just python main file. However you can use any language you want.

You have to provide input data for the task. In this tutorial we will provide hello: "world" as input data, it is just an example, but you can provide any data you want as long as it is JSON. Navigate to Task page for different examples of input data such as Image Classification, Text Classification, Customer Support, PDF Reviewe etc.

This is the code to create a task. Some parameters are highlighted.

hello_task.py
import requests api_key = "YOUR_API_KEY" headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": f"Bearer {api_key}" } queue_name = "my_first_queue" url = "http://api.qrambo.io/queues/{queue_name}/tasks" response = requests.post(url, json={ "input_data": { # You can add any data in here if you want hello: "world" }, }, headers=headers) print(response.json()) # if it returns success == true, it is ok

You can get more info for this API request in the documentation -> CreateTask Endpoint

Check the Task in our Dashboard

If we get 200 response, it means the task has been created successfully. Let’s check the task in our dashboard.

  1. Open your dashboard and change environment to dev.

  2. Click on Tasks tab.

  3. You will see the task you created.

Last Step: Clear the Task

Let’s cancel our task because we will not need for the next steps.

  1. Click on Tasks tab.

  2. Click on the task you created.

  3. Click on Cancel button.

Next Steps

In the next step we will learn how to get result of the task to our server.

Last updated on