더위키:openAPI (r20판)
편집일시 :
분류
2020년 10월 20일부터 API 요청시 사전발급된 키가 필요합니다.
키 발급시 사용목적에 따른 승인 절차가 필요하며, 할당요청수가 목적에 따라 부여됩니다.
키 발급이 필요한 경우 기술지원을 통해 문의해주세요.
키 발급시 사용목적에 따른 승인 절차가 필요하며, 할당요청수가 목적에 따라 부여됩니다.
키 발급이 필요한 경우 기술지원을 통해 문의해주세요.
1. 개요[편집]
더위키에서는 다음과 같은 API를 제공하고 있습니다. 관련된 문의사항은 기술 지원을 통해 문의해주시기 바랍니다.
API는 UTF-8 인코딩으로 동작합니다. ASCII 인코딩을 사용하는 텍스트 값을 전달할 경우 API가 정상적으로 동작하지 않습니다.
2. 기능[편집]
- 문서의 RAW 확인
- 특정 덤프 버전 지정 가능
- 파일: 문법의 이미지 확인
3. 예외 오류[편집]
4. 값[편집]
4.1. docReVersion[편집]
- 허용되는 값 : 1 이상의 정수
4.2. docVersion[편집]
- 허용되는 값 : 160229, 160329, 160425, 160530, 160627, 160728, 160829, 161031, 170327, 180326, 180925, 190312, 200302
4.3. title[편집]
- 허용되는 값 : 제한 없음
4.4. namespace[편집]
- 허용되는 값 : 0, 1, 2, 3, 4, 6, 8, 10, 11
namespace 값이 전달되지 않을 경우 0 으로 지정됨.
각 값 별로 다음 namespace로 설정됨 (괄호안의 namespace는 덤프 버전이 180925일 경우에 해당)
4.5. w[편집]
- 허용되는 값 : 파일 문서 형식 (파일:ABC.jpg)
4.6. key[편집]
- 허용되는 값 : 영문 대문자 및 숫자 조합
5. 사용 방법[편집]
5.1. 최신 버전의 문서 raw를 호출하는 방법[편집]
$request = array('namespace'=>10, 'title'=>'홈', 'key'=>'API KEY 값');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://thewiki.kr/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, [rev] => doc reversion, [deleted] => boolean
5.1.1. 특정 덤프 버전의 raw를 호출하는 경우[편집]
$request = array('namespace'=>6, 'title'=>'대문', 'docVersion'=>170327, 'key'=>'API KEY 값');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://thewiki.kr/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] => 덤프 버전의 전체 문서 개수, [rev] => 0
5.1.2. 특정 리버전의 raw를 호출하는 경우[편집]
$request = array('namespace'=>10, 'title'=>'홈', 'docReVersion'=>20, 'key'=>'API KEY 값');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://thewiki.kr/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, [deleted] => boolean
5.2. 이미지 호출하는 방법[편집]
$request = array('w'=>'파일:!!!!!.jpg', 'key'=>'API KEY 값');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://thewiki.kr/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] => 이미지 URL 주소
5.2.1. 처리되지 않은 이미지를 호출하는 경우[편집]
return : [status] => fail, [link] => 대기열 번호
5.2.2. 처리되었으나 검증이 진행중인 이미지를 호출하는 경우[편집]
return : [status] => processing, [link] => 대기열 번호