서비스 인증 절차
1. 제휴 절차에 따라 API Key를 발급 받습니다.
2. API Key 검증 후 만료시점과 단말기의 고유 ID를 반환 받습니다.
※제휴 이후 서비스 운영시에만 운영계 인증 코드가 발급 됩니다.
서비스 인증 코드 검증
서비스 URL [POST/GET] : https://mlpams.hyundai-mnsoft.com:9044/auth/check_code
-> 응답 : 인증코드 만료 시간(Unix Time format)
Request Header :
POST /auth/code /1.0 HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Request body [POST] :
//application/x-www-form-urlencoded 형식
code = 발급받은 API Key
Request example [POST] :
var data = "code=발급받은 API Key";
var xhr = new XMLHttpRequest();
xhr.open("POST", "https://mlpams.hyundai-mnsoft.com:9044/auth/check_code");
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
xhr.send(data);
Request example [GET] :
https://mlpams.hyundai-mnsoft.com:9044/auth/check_code?code=발급받은 API Key //위에서 발급받은 auth_code
Response example :
{
“expires_at”: “int” // API Key 만료시점
“device_id”:”string” // 단말기의 고유 ID
}
에러 코드
HTTP 상태코드 | Auth | 설명 |
---|---|---|
200 | 0000 | 성공. |
4xx | 3001 | 유효하지 않은 메시지. |
401 | 3002 | AuthCode 인가 실패. DeviceID, SerialNo를 알지 못함. |
4xx | 3003 | 승인되지 않은 Device |
4xx | 3004 | 승인되지 않은 Service |
5xx | 4001 | 서버 메시지 처리 실패 |
5xx | 4002 | 서버 요청 timeout |
5xx | 4003 | 서버 요청 실패 |