본문으로 건너뛰기
사용자

Cernium/ACLGroup/api(r10판 Blame)

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