본문으로 건너뛰기
사용자

Cernium/ACLGroup/api(r15판 Blame)

r15
r1
1[include(틀:상위 문서, 문서명1=사용자:Cernium/ACLGroup)]
2----
r11
3
4[목차]
5
r1
6{{{GET /api/v0/aclgroup}}}
7{{{PUT /api/v0/aclgroup}}}
r2
8{{{DELETE /api/v0/aclgroup}}}
9
r3
10https://theseed.io/thread/YummyGiganticBrashDistribution
r4
11[[https://theseed.io/thread/YummyGiganticBrashDistribution|#]]
12
r5
13https://theseed.io/internal/admin/thread/YummyGiganticBrashDistribution/hide
14
r7
15== 기본 ==
r5
16{{{#!syntax python
r7
17import requests
18
r5
19headers = {
r6
20 'Authorization': 'Bearer API_TOKEN_HERE'
21}
r7
22}}}
r10
23
24== 목록 ==
r9
25{{{#!syntax python
r10
26data = {
27 'group': '인증된 사용자'
28}
29
30response = requests.get('https://theseed.io/api/v0/aclgroup?from=12029', headers=headers, data=data) #?from=12029는 제거해도 됨
31print(response.text)
32}}}
33
r12
34===# 목록/출력 #===
r10
35{{{#!syntax python
r9
36{
37 "groups": [
38 "차단된 사용자",
39 "인증된 사용자",
40 "관리자",
41 "로그인 허용 차단",
42 "Rainbow",
43 "경고-테스트",
44 "Pink",
45 "test",
46 "Color #1",
47 "Color #2",
48 "Gradient #1",
49 "Gradient #2"
50 ],
51 "group": "인증된 사용자",
52 "aclgroup": [
53 {
54 "id": 12029,
55 "ip": null,
56 "username": "Cernium",
57 "note": "https://namu.wiki/contribution/fcea127e-0cc6-4080-ae53-93f3aac0d69f/document",
58 "created": 1741256491,
59 "expired": null
60 }
61 ]
62}
63 ... (생략)
64}}}
r7
65
66== 추가 ==
67{{{#!syntax python
r5
68data = {
r7
69 'group': '로그인 허용 차단', #ACLGroup 이름
r15
70 #'ip': '127.0.0.1', #mode가 ip인 경우 사용
71 'username': 'Cernium', #사용자 이름
r7
72 'note': 'api test', #사유
r13
73 'expire': '20', #추가할 시간(초); 0이면 무기한
r7
74 'mode': 'username' #ip OR username
r6
75}
r5
76response = requests.post('https://theseed.io/api/v0/aclgroup', headers=headers, data=data)
r7
77}}}
78
79== 제거 ==
80{{{#!syntax python
81data = {
82 'group': '경고-테스트', #ACLGroup 이름
83 'id': '14559', #차단 id
84 'note': 'api test' #사유
85}
86response = requests.delete('https://theseed.io/api/v0/aclgroup', headers=headers, data=data)
r5
87}}}