B2B » 이력 » 버전 7
이름없음, 2021/06/02 10:40
1 | 4 | 이름없음 | h2. *Intro* |
---|---|---|---|
2 | 2 | 이름없음 | |
3 | 4 | 이름없음 | b2b에서 수행할 수 있는 api입니다.(설명 추가) |
4 | 1 | 이름없음 | |
5 | 4 | 이름없음 | *토큰 발급 받기* |
6 | 1 | 이름없음 | |
7 | 4 | 이름없음 | B2B api에선 issueDid(second party유형의 did를 새로 발급) 요청을 제외한 모든 헤더에 토큰을 포함합니다. |
8 | 1 | 이름없음 | |
9 | 4 | 이름없음 | {{collapse(api 공통 설명 영역으로 옮기면 좋을 것 같은 "토큰 발급 방법") |
10 | 1 | 이름없음 | |
11 | 4 | 이름없음 | 1. signin 요청을 통해 토큰을 발급받습니다. |
12 | |||
13 | 2. 요청 헤더에 아래 key를 적용해 토큰 값을 넣어줍니다. |
||
14 | |||
15 | | key | value | description | |
||
16 | | X-Auth-Token | 발급 받아 사용 | did마다 인증을 위한 고유한 토큰을 가지며 최대 6시간 유효합니다. | |
||
17 | |||
18 | }} |
||
19 | |||
20 | h2. UploadResolver |
||
21 | |||
22 | GraphQL Multipart-Form으로 파일 업로드 시 *operations* 키 값으로 "이 형식":https://graphql-kr.github.io/learn/serving-over-http/#post-request<notextile></notextile>의 JSON 인코딩 바디를 포함하여 요청을 보냅니다. |
||
23 | |||
24 | operations 내부의 *variables* 문법 사용 방법은 "이 문서":https://graphql.org/learn/queries/#variables<notextile></notextile>를 참고할 수 있습니다. |
||
25 | |||
26 | *1. uploadImage*<notextile></notextile> <notextile></notextile>%{color: #993300;}(Multipart-Form) @api 요청 링크 추가@%<notextile></notextile> |
||
27 | |||
28 | Martipart-Form 요청 형식 |
||
29 | |||
30 | | key | value | description | |
||
31 | | file | | 업로드 할 파일 또는 파일의 경로 %{color: #ff0000;}(확장자 표시해주기)% | |
||
32 | | operations | | 표준 GraphQL Post 요청 형식에 따른 쿼리를 작성합니다. | |
||
33 | |||
34 | 요청 필드 |
||
35 | |||
36 | | field | type | description | |
||
37 | | did | String | b2b의 did | |
||
38 | |||
39 | 5 | 이름없음 | 요청 예시 |
40 | |||
41 | <pre> |
||
42 | {"query":"mutation($did: String){uploadImage(did: $did){command result{originalFilename fullUrlPath}}}","variables":{"did":"HmxD2jgZhBWEGcBnC66Kja"}} |
||
43 | </pre> |
||
44 | |||
45 | 4 | 이름없음 | {{collapse(beautify) |
46 | |||
47 | <pre> |
||
48 | {"query": "mutation($did: String){ |
||
49 | uploadImage(did: $did){ |
||
50 | 7 | 이름없음 | command |
51 | 4 | 이름없음 | result{ |
52 | 7 | 이름없음 | originalFilename |
53 | fullUrlPath |
||
54 | 1 | 이름없음 | } } }", |
55 | "variables":{"did":"HmxD2jgZhBWEGcBnC66Kja"} |
||
56 | } |
||
57 | </pre> |
||
58 | |||
59 | }} |
||
60 | 6 | 이름없음 | |
61 | 응답 필드 |
||
62 | |||
63 | | field | type | description | |
||
64 | | command | String | 응답 Command 종류 | |
||
65 | | originalFilename | String | 업로드 한 파일 이름 | |
||
66 | | fullUrlPath | String | 저장된 경로 | |
||
67 | 4 | 이름없음 | |
68 | 응답 예시 |
||
69 | |||
70 | <pre> |
||
71 | { |
||
72 | "data": { |
||
73 | "uploadImage": { |
||
74 | "command": "uploadImage", |
||
75 | "result": [ |
||
76 | { |
||
77 | "originalFilename": "100.jpg", |
||
78 | "fullUrlPath": "https://cdn.myd.world/6f9b5a50b175e81cf2892b6da61d21af/images/GTfQBO/100.jpg" |
||
79 | } |
||
80 | ] |
||
81 | } |
||
82 | } |
||
83 | } |
||
84 | </pre> |
||
85 | |||
86 | *2. uploadHtml*<notextile></notextile> <notextile></notextile>%{color: #993300;}(Multipart-Form)% |
||
87 | |||
88 | *3. uploadEventZip*<notextile></notextile> <notextile></notextile>%{color: #993300;}(Multipart-Form)% |
||
89 | |||
90 | *4. uploadAdvertizeZip*<notextile></notextile> <notextile></notextile>%{color: #993300;}(Multipart-Form)% |
||
91 | |||
92 | *5. uploadDsiclaimer* |
||
93 | |||
94 | *6. registerConfig* |
||
95 | |||
96 | *7. uploadEventList* |
||
97 | |||
98 | *8. uploadResource*<notextile></notextile> <notextile></notextile>%{color: #993300;}(Multipart-Form)% |
||
99 | |||
100 | *9. uploadZip* %{color: #993300;}(Multipart-Form)% |
||
101 | |||
102 | h2. SettlementResolver |
||
103 | |||
104 | h2. MessageResolver |
||
105 | |||
106 | h2. AuthResolver |