알림
알림 받기 설정 등록
특정 도서가 특정 도서관에서 대출 가능해졌을 때 알림을 받을 수 있도록 설정합니다. 이미 등록된 활성 알림 받기 설정이 있으면 중복 등록할 수 없습니다. 비활성화된 기존 설정이 있으면 다시 활성화될 수 있습니다. 실제 알림은 서버가 대출 가능 여부를 확인한 뒤 생성합니다.
POST
/
api
/
v1
/
notifications
/
subscriptions
알림 받기 설정 등록
curl --request POST \
--url https://k-polaris.life/api/v1/notifications/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"isbn": 9791191111111,
"libraryId": 10
}
'import requests
url = "https://k-polaris.life/api/v1/notifications/subscriptions"
payload = {
"isbn": 9791191111111,
"libraryId": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({isbn: 9791191111111, libraryId: 10})
};
fetch('https://k-polaris.life/api/v1/notifications/subscriptions', 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://k-polaris.life/api/v1/notifications/subscriptions",
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([
'isbn' => 9791191111111,
'libraryId' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://k-polaris.life/api/v1/notifications/subscriptions"
payload := strings.NewReader("{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://k-polaris.life/api/v1/notifications/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://k-polaris.life/api/v1/notifications/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json;charset=UTF-8
Response
성공
Previous
알림 받기 설정 해제<p>특정 도서와 도서관에 대한 알림 받기 설정을 해제합니다. 이미 생성된 알림 기록은 삭제되지 않습니다. 해제할 설정이 없어도 요청은 성공합니다.</p>
Next
⌘I
알림 받기 설정 등록
curl --request POST \
--url https://k-polaris.life/api/v1/notifications/subscriptions \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json;charset=UTF-8' \
--data '
{
"isbn": 9791191111111,
"libraryId": 10
}
'import requests
url = "https://k-polaris.life/api/v1/notifications/subscriptions"
payload = {
"isbn": 9791191111111,
"libraryId": 10
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json;charset=UTF-8"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/json;charset=UTF-8'
},
body: JSON.stringify({isbn: 9791191111111, libraryId: 10})
};
fetch('https://k-polaris.life/api/v1/notifications/subscriptions', 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://k-polaris.life/api/v1/notifications/subscriptions",
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([
'isbn' => 9791191111111,
'libraryId' => 10
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json;charset=UTF-8"
],
]);
$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://k-polaris.life/api/v1/notifications/subscriptions"
payload := strings.NewReader("{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json;charset=UTF-8")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://k-polaris.life/api/v1/notifications/subscriptions")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json;charset=UTF-8")
.body("{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://k-polaris.life/api/v1/notifications/subscriptions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json;charset=UTF-8'
request.body = "{\n \"isbn\": 9791191111111,\n \"libraryId\": 10\n}"
response = http.request(request)
puts response.read_body