Update existing contest. For internal usage only
curl --request PATCH \
--url https://backend.swap.coffee/v1/contests/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [
{
"args": [
"<string>"
]
}
],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": true
}
'import requests
url = "https://backend.swap.coffee/v1/contests/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [{ "args": ["<string>"] }],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": True
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
references: [{ref_name: '<string>', ref_url: '<string>'}],
conditions: [{args: ['<string>']}],
rewards: [{reward: '<string>', place: 123, place_from: 123, place_to: 123}],
start_time_unix: 123,
end_time_unix: 123,
image_url: '<string>',
total_reward: '<string>',
hidden: true
})
};
fetch('https://backend.swap.coffee/v1/contests/{id}', 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://backend.swap.coffee/v1/contests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'references' => [
[
'ref_name' => '<string>',
'ref_url' => '<string>'
]
],
'conditions' => [
[
'args' => [
'<string>'
]
]
],
'rewards' => [
[
'reward' => '<string>',
'place' => 123,
'place_from' => 123,
'place_to' => 123
]
],
'start_time_unix' => 123,
'end_time_unix' => 123,
'image_url' => '<string>',
'total_reward' => '<string>',
'hidden' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://backend.swap.coffee/v1/contests/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://backend.swap.coffee/v1/contests/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.swap.coffee/v1/contests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"info": {
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [
{
"args": [
"<string>"
]
}
],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": true
}
}{
"error": "<string>"
}Contests
Update existing contest. For internal usage only
PATCH
/
v1
/
contests
/
{id}
Update existing contest. For internal usage only
curl --request PATCH \
--url https://backend.swap.coffee/v1/contests/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [
{
"args": [
"<string>"
]
}
],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": true
}
'import requests
url = "https://backend.swap.coffee/v1/contests/{id}"
payload = {
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [{ "args": ["<string>"] }],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": True
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: '<string>',
description: '<string>',
references: [{ref_name: '<string>', ref_url: '<string>'}],
conditions: [{args: ['<string>']}],
rewards: [{reward: '<string>', place: 123, place_from: 123, place_to: 123}],
start_time_unix: 123,
end_time_unix: 123,
image_url: '<string>',
total_reward: '<string>',
hidden: true
})
};
fetch('https://backend.swap.coffee/v1/contests/{id}', 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://backend.swap.coffee/v1/contests/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'title' => '<string>',
'description' => '<string>',
'references' => [
[
'ref_name' => '<string>',
'ref_url' => '<string>'
]
],
'conditions' => [
[
'args' => [
'<string>'
]
]
],
'rewards' => [
[
'reward' => '<string>',
'place' => 123,
'place_from' => 123,
'place_to' => 123
]
],
'start_time_unix' => 123,
'end_time_unix' => 123,
'image_url' => '<string>',
'total_reward' => '<string>',
'hidden' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Api-Key: <api-key>"
],
]);
$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://backend.swap.coffee/v1/contests/{id}"
payload := strings.NewReader("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("X-Api-Key", "<api-key>")
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.patch("https://backend.swap.coffee/v1/contests/{id}")
.header("X-Api-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://backend.swap.coffee/v1/contests/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["X-Api-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"<string>\",\n \"description\": \"<string>\",\n \"references\": [\n {\n \"ref_name\": \"<string>\",\n \"ref_url\": \"<string>\"\n }\n ],\n \"conditions\": [\n {\n \"args\": [\n \"<string>\"\n ]\n }\n ],\n \"rewards\": [\n {\n \"reward\": \"<string>\",\n \"place\": 123,\n \"place_from\": 123,\n \"place_to\": 123\n }\n ],\n \"start_time_unix\": 123,\n \"end_time_unix\": 123,\n \"image_url\": \"<string>\",\n \"total_reward\": \"<string>\",\n \"hidden\": true\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"info": {
"title": "<string>",
"description": "<string>",
"references": [
{
"ref_name": "<string>",
"ref_url": "<string>"
}
],
"conditions": [
{
"args": [
"<string>"
]
}
],
"rewards": [
{
"reward": "<string>",
"place": 123,
"place_from": 123,
"place_to": 123
}
],
"start_time_unix": 123,
"end_time_unix": 123,
"image_url": "<string>",
"total_reward": "<string>",
"hidden": true
}
}{
"error": "<string>"
}Authorizations
Path Parameters
Body
application/json
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
in seconds
in seconds
⌘I