본문으로 건너뛰기
사용자

Cernium/ACLGroup/api(r11판 Blame)

r11
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
18import json
19
r5
20headers = {
r6
21 'Authorization': 'Bearer API_TOKEN_HERE'
22}
r7
23}}}
r10
24
25== 목록 ==
r9
26{{{#!syntax python
r10
27data = {
28 'group': '인증된 사용자'
29}
30
31response = requests.get('https://theseed.io/api/v0/aclgroup?from=12029', headers=headers, data=data) #?from=12029는 제거해도 됨
32print(response.text)
33}}}
34
35=== 목록/출력 ===
36{{{#!syntax python
r9
37{
38 "groups": [
39 "차단된 사용자",
40 "인증된 사용자",
41 "관리자",
42 "로그인 허용 차단",
43 "Rainbow",
44 "경고-테스트",
45 "Pink",
46 "test",
47 "Color #1",
48 "Color #2",
49 "Gradient #1",
50 "Gradient #2"
51 ],
52 "group": "인증된 사용자",
53 "aclgroup": [
54 {
55 "id": 12029,
56 "ip": null,
57 "username": "Cernium",
58 "note": "https://namu.wiki/contribution/fcea127e-0cc6-4080-ae53-93f3aac0d69f/document",
59 "created": 1741256491,
60 "expired": null
61 }
62 ]
63}
64 ... (생략)
65}}}
r7
66
67== 추가 ==
68{{{#!syntax python
r5
69data = {
r7
70 'group': '로그인 허용 차단', #ACLGroup 이름
71 'username': 'Cernium', #사용자 이름; mode=ip이면 'ip'로
72 'note': 'api test', #사유
73 'expire': '20', #추가할 시간(초)
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}}}