Skip to main content
POST
/
api
/
v2
/
Add Poll Order
curl --request POST \
  --url https://undrctrl.id/api/v2/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "key": "apiKey",
  "action": "add",
  "service": 123,
  "link": "https://example.com/page",
  "quantity": 100,
  "answer_number": 1
}
'
import requests

url = "https://undrctrl.id/api/v2/"

payload = {
    "key": "apiKey",
    "action": "add",
    "service": 123,
    "link": "https://example.com/page",
    "quantity": 100,
    "answer_number": 1
}
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({
    key: 'apiKey',
    action: 'add',
    service: 123,
    link: 'https://example.com/page',
    quantity: 100,
    answer_number: 1
  })
};

fetch('https://undrctrl.id/api/v2/', 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://undrctrl.id/api/v2/",
  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([
    'key' => 'apiKey',
    'action' => 'add',
    'service' => 123,
    'link' => 'https://example.com/page',
    'quantity' => 100,
    'answer_number' => 1
  ]),
  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://undrctrl.id/api/v2/"

	payload := strings.NewReader("{\n  \"key\": \"apiKey\",\n  \"action\": \"add\",\n  \"service\": 123,\n  \"link\": \"https://example.com/page\",\n  \"quantity\": 100,\n  \"answer_number\": 1\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://undrctrl.id/api/v2/")
  .header("Content-Type", "application/json")
  .body("{\n  \"key\": \"apiKey\",\n  \"action\": \"add\",\n  \"service\": 123,\n  \"link\": \"https://example.com/page\",\n  \"quantity\": 100,\n  \"answer_number\": 1\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://undrctrl.id/api/v2/")

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  \"key\": \"apiKey\",\n  \"action\": \"add\",\n  \"service\": 123,\n  \"link\": \"https://example.com/page\",\n  \"quantity\": 100,\n  \"answer_number\": 1\n}"

response = http.request(request)
puts response.read_body
{
  "order": 23501
}
{
  "error": "Invalid API key"
}
{
  "error": "Incorrect request"
}

Body

application/json
key
string
required

The API key for authentication

Example:

"apiKey"

action
string
required

Action to be performed, set to add for poll order

Example:

"add"

service
integer
required

Service ID for the poll order

Example:

123

Link to the page for the order

Example:

"https://example.com/page"

quantity
integer
required

Needed quantity for the order

Example:

100

answer_number
integer
required

Answer number of the poll to be targeted

Example:

1

Response

OK

order
integer
Example:

23501