본문으로 건너뛰기
사용자

Cernium/ACLGroup/api(r9판 Blame)

r9
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}}}
r9
21{{{#!folding 출력
22{{{#!syntax python
23{
24 "groups": [
25 "차단된 사용자",
26 "인증된 사용자",
27 "관리자",
28 "로그인 허용 차단",
29 "Rainbow",
30 "경고-테스트",
31 "Pink",
32 "test",
33 "Color #1",
34 "Color #2",
35 "Gradient #1",
36 "Gradient #2"
37 ],
38 "group": "인증된 사용자",
39 "aclgroup": [
40 {
41 "id": 12029,
42 "ip": null,
43 "username": "Cernium",
44 "note": "https://namu.wiki/contribution/fcea127e-0cc6-4080-ae53-93f3aac0d69f/document",
45 "created": 1741256491,
46 "expired": null
47 }
48 ]
49}
50 ... (생략)
51}}}
52}}}
r7
53
54== 목록 ==
r8
55{{{#!syntax python
56data = {
57 'group': '인증된 사용자'
58}
r7
59
r8
60response = requests.get('https://theseed.io/api/v0/aclgroup?from=12029', headers=headers, data=data) #?from=12029는 제거해도 됨
61print(response.text)
62}}}
63
r7
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}}}