BZP
Edytuj alert BZP
Zmienia nazwę, filtry, rodzaje powiadomień lub włącza/wyłącza alert.
PATCH
/
v1
/
bzp
/
alerts
/
{alert_id}
Edytuj alert BZP
curl --request PATCH \
--url https://api.krdata.pl/v1/bzp/alerts/{alert_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"kinds": [],
"enabled": true,
"keywords": [
"<string>"
],
"exclude_keywords": [
"<string>"
],
"cpv": [
"<string>"
],
"provinces": [
"<string>"
],
"cities": [
"<string>"
],
"authorities": [
"<string>"
],
"order_types": [
"<string>"
]
}
'import requests
url = "https://api.krdata.pl/v1/bzp/alerts/{alert_id}"
payload = {
"name": "<string>",
"kinds": [],
"enabled": True,
"keywords": ["<string>"],
"exclude_keywords": ["<string>"],
"cpv": ["<string>"],
"provinces": ["<string>"],
"cities": ["<string>"],
"authorities": ["<string>"],
"order_types": ["<string>"]
}
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({
name: '<string>',
kinds: [],
enabled: true,
keywords: ['<string>'],
exclude_keywords: ['<string>'],
cpv: ['<string>'],
provinces: ['<string>'],
cities: ['<string>'],
authorities: ['<string>'],
order_types: ['<string>']
})
};
fetch('https://api.krdata.pl/v1/bzp/alerts/{alert_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://api.krdata.pl/v1/bzp/alerts/{alert_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([
'name' => '<string>',
'kinds' => [
],
'enabled' => true,
'keywords' => [
'<string>'
],
'exclude_keywords' => [
'<string>'
],
'cpv' => [
'<string>'
],
'provinces' => [
'<string>'
],
'cities' => [
'<string>'
],
'authorities' => [
'<string>'
],
'order_types' => [
'<string>'
]
]),
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://api.krdata.pl/v1/bzp/alerts/{alert_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\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://api.krdata.pl/v1/bzp/alerts/{alert_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.krdata.pl/v1/bzp/alerts/{alert_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 \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"kinds": [
"new"
],
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"keywords": [
"<string>"
],
"exclude_keywords": [
"<string>"
],
"cpv": [
"<string>"
],
"provinces": [
"<string>"
],
"cities": [
"<string>"
],
"authorities": [
"<string>"
],
"order_types": [
"<string>"
],
"enabled": true,
"events_total": 0,
"events_7d": 0,
"last_event_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Path Parameters
Body
application/json
Required string length:
1 - 80Required array length:
1 - 3 elementsAvailable options:
new, change, result Maximum array length:
20Maximum array length:
20Maximum array length:
50Maximum array length:
16Maximum array length:
20Maximum array length:
10Maximum array length:
3Response
Successful Response
Required string length:
1 - 80Required array length:
1 - 3 elementsAvailable options:
new, change, result Maximum array length:
20Maximum array length:
20Maximum array length:
50Maximum array length:
16Maximum array length:
20Maximum array length:
10Maximum array length:
3⌘I
Edytuj alert BZP
curl --request PATCH \
--url https://api.krdata.pl/v1/bzp/alerts/{alert_id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"kinds": [],
"enabled": true,
"keywords": [
"<string>"
],
"exclude_keywords": [
"<string>"
],
"cpv": [
"<string>"
],
"provinces": [
"<string>"
],
"cities": [
"<string>"
],
"authorities": [
"<string>"
],
"order_types": [
"<string>"
]
}
'import requests
url = "https://api.krdata.pl/v1/bzp/alerts/{alert_id}"
payload = {
"name": "<string>",
"kinds": [],
"enabled": True,
"keywords": ["<string>"],
"exclude_keywords": ["<string>"],
"cpv": ["<string>"],
"provinces": ["<string>"],
"cities": ["<string>"],
"authorities": ["<string>"],
"order_types": ["<string>"]
}
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({
name: '<string>',
kinds: [],
enabled: true,
keywords: ['<string>'],
exclude_keywords: ['<string>'],
cpv: ['<string>'],
provinces: ['<string>'],
cities: ['<string>'],
authorities: ['<string>'],
order_types: ['<string>']
})
};
fetch('https://api.krdata.pl/v1/bzp/alerts/{alert_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://api.krdata.pl/v1/bzp/alerts/{alert_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([
'name' => '<string>',
'kinds' => [
],
'enabled' => true,
'keywords' => [
'<string>'
],
'exclude_keywords' => [
'<string>'
],
'cpv' => [
'<string>'
],
'provinces' => [
'<string>'
],
'cities' => [
'<string>'
],
'authorities' => [
'<string>'
],
'order_types' => [
'<string>'
]
]),
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://api.krdata.pl/v1/bzp/alerts/{alert_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\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://api.krdata.pl/v1/bzp/alerts/{alert_id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.krdata.pl/v1/bzp/alerts/{alert_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 \"name\": \"<string>\",\n \"kinds\": [],\n \"enabled\": true,\n \"keywords\": [\n \"<string>\"\n ],\n \"exclude_keywords\": [\n \"<string>\"\n ],\n \"cpv\": [\n \"<string>\"\n ],\n \"provinces\": [\n \"<string>\"\n ],\n \"cities\": [\n \"<string>\"\n ],\n \"authorities\": [\n \"<string>\"\n ],\n \"order_types\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"kinds": [
"new"
],
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"keywords": [
"<string>"
],
"exclude_keywords": [
"<string>"
],
"cpv": [
"<string>"
],
"provinces": [
"<string>"
],
"cities": [
"<string>"
],
"authorities": [
"<string>"
],
"order_types": [
"<string>"
],
"enabled": true,
"events_total": 0,
"events_7d": 0,
"last_event_at": "2023-11-07T05:31:56Z"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}
