[include(TheWiki:공식 문서)] [목차] = 개요 = The Wiki에서는 다음과 같은 API를 제공하고 있습니다. 관련된 문의사항은 [[https://thewiki.ga/request/|기술 지원]]을 통해 문의해주시기 바랍니다. = 기능 = * 문서의 RAW 확인 * 특정 덤프 버전 지정 가능 * --특정 IP의 덤프 버전 지정 기능(해당 IP의 개인 설정으로 설정된 덤프 버전)-- (예정) * 파일: 문법의 이미지 확인 = 예외 오류 = || Message || 설명 || 해결방안 || || main db error || DB 서버 오류 || [[https://thewiki.ga/request/|기술 지원]] 요청 || || sub db error || DB 서버 오류 || [[https://thewiki.ga/request/|기술 지원]] 요청 || || mongoDB server error || DB 서버 오류 || [[https://thewiki.ga/request/|기술 지원]] 요청 || || please check document title || title이 지정되지 않음 || 문서명을 title 값으로 전달하세요. || || forbidden || 권한 없음 || 없음 || || reversion error || 해당 docReVersion 값의 raw 데이터가 없음 || docReVersion 값 수정 || || please check document reversion || 해당 docVersion 값의 덤프 버전이 없음 || docVersion 값 수정 || || empty document || 비어있는 문서 || || || API error || 정의되지 않은 오류 || [[https://thewiki.ga/request/|기술 지원]] 요청 || = 값 = == docReVersion == * 허용되는 값 : 1 이상의 정수 해당 docReVersion 값의 raw 데이터를 return함 == docVersion == * 허용되는 값 : 160229, 160329, 160425, 160530, 160627, 160728, 160829, 161031, 170327, 180326, 180925 해당 docVersion 값의 덤프 버전을 기준으로 raw 데이터를 return함 == title == * 허용되는 값 : 제한 없음 해당 title의 문서 raw를 return함 == namespace == * 허용되는 값 : 0, 1, 2, 3, 4, 6, 8, 10, 11 해당 namespace와 title의 문서 raw를 return함 namespace 값이 전달되지 않을 경우 0 으로 지정됨. 각 값 별로 다음 namespace로 설정됨 (괄호안의 namespace는 덤프 버전이 180925일 경우에 해당) || 전달 값 || namespace || || 0 || || || 1 || 틀 || || 2 || 분류 || || 3 || 파일 || || 4 || 사용자 || || 6 || 나무위키 (알파위키) || || 8 || 휴지통 || || 10 || TheWiki || || 11 || 이미지 (집단창작) || == w == * 허용되는 값 : 파일 문서 형식 (파일:ABC.jpg) 해당 파일 문서의 이미지를 return 함 = 사용 방법 = == 최신 버전의 문서 raw를 호출하는 방법 == {{{ $request = array('namespace'=>10, 'title'=>'홈'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://thewiki.ga/API.php'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result= json_decode(curl_exec($ch)); curl_close($ch);}}} return : [status] => success, [type] => raw, [data] => RAW DATA === 이동된 문서의 raw를 호출하는 경우 === return : [status] => success, [type] => refresh, [link] => /w/TheWiki:홈, [namespace] => 10, [title] => 홈 === 특정 덤프 버전의 raw를 호출하는 경우 === {{{ $request = array('namespace'=>6, 'title'=>'대문', 'docVersion'=>170327); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://thewiki.ga/API.php'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result= json_decode(curl_exec($ch)); curl_close($ch);}}} return : [status] => success, [type] => raw, [data] => RAW DATA, [contribution] => 기여자 목록, [count] => 덤프 버전의 전체 문서 개수 === 특정 리버전의 raw를 호출하는 경우 === {{{ $request = array('namespace'=>10, 'title'=>'홈', 'docReVersion'=>20); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://thewiki.ga/API.php'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result= json_decode(curl_exec($ch)); curl_close($ch);}}} return : [status] => success, [type] => raw, [data] => RAW DATA == 이미지 호출하는 방법 == {{{ $request = array('w'=>'파일:!!!!!.jpg'); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'https://thewiki.ga/API.php'); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $request); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result= curl_exec($ch); curl_close($ch);}}} return : [status] => success, [link] => {{{https://lh3.googleusercontent.com/-HgzPikXClJM/WnnK_sKKGXI/AAAAAAAAK0A/wtFQ_h2fMfIACw7Mqj6F2x4I_-UABdZcgCHMYCw/s0/21ab2ab1ffdcdaa3e9dcc05cf78e4ca763d3829f.jpg}}} === 처리되지 않은 이미지를 호출하는 경우 === return : [status] => fail, [link] => 대기열 번호 === 처리되었으나 검증이 진행중인 이미지를 호출하는 경우 === return : [status] => processing, [link] => 대기열 번호