API
getTaskResult: Task Result
Retrieves the solution for a previously created task using its task ID. Poll this endpoint until status is ‘ready’.
POST
/
getTaskResult
Get task result
curl --request POST \
--url https://salamoonder.com/api/getTaskResult \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "sr-xxxx-xxxx-xxxx",
"taskId": "118b941e-c035-4429-8ec3-18d5d19ccf9b"
}
'import requests
url = "https://salamoonder.com/api/getTaskResult"
payload = {
"api_key": "sr-xxxx-xxxx-xxxx",
"taskId": "118b941e-c035-4429-8ec3-18d5d19ccf9b"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_key: 'sr-xxxx-xxxx-xxxx', taskId: '118b941e-c035-4429-8ec3-18d5d19ccf9b'})
};
fetch('https://salamoonder.com/api/getTaskResult', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://salamoonder.com/api/getTaskResult",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => 'sr-xxxx-xxxx-xxxx',
'taskId' => '118b941e-c035-4429-8ec3-18d5d19ccf9b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://salamoonder.com/api/getTaskResult"
payload := strings.NewReader("{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://salamoonder.com/api/getTaskResult")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://salamoonder.com/api/getTaskResult")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}"
response = http.request(request)
puts response.read_body{
"errorId": 0,
"solution": "<dict>",
"status": "ready"
}{
"error_code": 1,
"error_description": "Invalid taskId"
}Body
application/json
Response
Task result retrieved successfully
Previous
getBalance: Get BalanceRetrieves your current account balance. This uses the createTask endpoint with type 'getBalance' and returns the wallet balance immediately.
Next
⌘I
Get task result
curl --request POST \
--url https://salamoonder.com/api/getTaskResult \
--header 'Content-Type: application/json' \
--data '
{
"api_key": "sr-xxxx-xxxx-xxxx",
"taskId": "118b941e-c035-4429-8ec3-18d5d19ccf9b"
}
'import requests
url = "https://salamoonder.com/api/getTaskResult"
payload = {
"api_key": "sr-xxxx-xxxx-xxxx",
"taskId": "118b941e-c035-4429-8ec3-18d5d19ccf9b"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({api_key: 'sr-xxxx-xxxx-xxxx', taskId: '118b941e-c035-4429-8ec3-18d5d19ccf9b'})
};
fetch('https://salamoonder.com/api/getTaskResult', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://salamoonder.com/api/getTaskResult",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'api_key' => 'sr-xxxx-xxxx-xxxx',
'taskId' => '118b941e-c035-4429-8ec3-18d5d19ccf9b'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://salamoonder.com/api/getTaskResult"
payload := strings.NewReader("{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://salamoonder.com/api/getTaskResult")
.header("Content-Type", "application/json")
.body("{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://salamoonder.com/api/getTaskResult")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"api_key\": \"sr-xxxx-xxxx-xxxx\",\n \"taskId\": \"118b941e-c035-4429-8ec3-18d5d19ccf9b\"\n}"
response = http.request(request)
puts response.read_body{
"errorId": 0,
"solution": "<dict>",
"status": "ready"
}{
"error_code": 1,
"error_description": "Invalid taskId"
}