Your EPS account
Sign in to view secure API documentation, update your account details, log support requests and much more.
Your email or password is incorrect. Please try again or reset your password.
If the issue persists please contact your EPS representative.
Reset your password
Please enter your email address below. We will send password reset instructions to the email associated with your EPS account.
Thank you
An email has been sent to your account email address with further instructions on how to reset your password.
API 키 인증 및 액세스
HTTP 인증 헤더를 사용하여 각 요청에 포함된 SHA-512 서명 해시와 API 키를 전송할 수 있습니다. 서명 해시는 API 키와 공유 암호, UNIX 시간 스탬프로 구성됩니다.
인증 헤더 생성
EPS에서 아래 형식을 사용하려면 인증 헤더가 필요합니다. 필요한 EPS
접두사에 유의하세요. 이 접두사는 올바른 인증 규칙이 요청에 적용되도록 합니다.
Authorization: EAN APIKey=yourAPIKey,Signature=sha512Hash,timestamp=yourUNIXTimestamp
signature
값은 API 키 + 공유 암호 + UNIX 시간 스탬프(초) 연결의 언솔티드 SHA-512 해시입니다.
timestamp
값은 signature
를 생성하는 데 사용된 것과 동일한 값이어야 합니다. 다른 시간 스탬프 값을 제공하면 EPS에서 서명 해시 값을 확인하지 못해 요청이 거부됩니다.
아래 전체 인증 헤더의 예가 나와 있습니다.
Authorization: EAN APIKey=dkc4wrkp7w58wx5v2jxen2kx,Signature=Mgup2Azf,timestamp=1476739212
인증 헤더 확인
테스트 요청을 시도하기 전에 EPS 서명 생성기에서 자체 코드를 테스트하세요.
참고: NTP 시계 동기화
EPS은 NTP(Network Time Protocol)를 사용하여 내부 서버 시간을 동기화합니다. NTP를 사용하는 경우에도 시계 동기화 문제가 발생해서는 안 됩니다. 대부분의 현대 운영체제는 이 서비스 또는 이와 유사한 시간 동기화 서비스를 지원합니다. OS 설명서를 참조하세요. 시스템은 적절한 시계 드리프트를 수용하기 위해 서버 시간 스탬프 앞뒤로 최대 5분의 시간 스탬프를 허용합니다.
서명 생성 코드 샘플
PHP
$apiKey = "abcdefg"; $secret = "1a2bc3"; $timestamp = time(); $authHeader = 'Authorization: EAN APIKey=' . $apiKey . ',Signature=' . hash("sha512", $apiKey.$secret.$timestamp) . ',timestamp=' . time();
JavaScript
var crypto = require('crypto'); var request = require('request'); var apiKey = "123"; var secret="123"; var timestamp = Math.round((new Date().getTime()/1000)); var hash = crypto.createHmac('sha256', apiKey+secret+timestamp).digest('hex'); var authHeaderValue = 'EAN APIKey=' +apiKey+ ',Signature=' + hash + ',timestamp=' + timestamp;
Java
import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.security.Timestamp; import java.util.Date; String apiKey = "123"; String secret = "123"; Date date= new java.util.Date(); Long timestamp = (date.getTime() / 1000); String signature = null; try { String toBeHashed = apiKey + secret + timestamp; MessageDigest md = MessageDigest.getInstance("SHA-512"); byte[] bytes = md.digest(toBeHashed.getBytes("UTF-8")); StringBuilder sb = new StringBuilder(); for(int i=0; i< bytes.length ;i++){ sb.append(Integer.toString((bytes[i] & 0xff) + 0x100, 16).substring(1)); } signature = sb.toString(); } catch (NoSuchAlgorithmException e) { e.printStackTrace(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } String authHeaderValue = "EAN APIKey=" + apiKey + ",Signature=" + signature + ",timestamp=" + timestamp;
Python
import hashlib import datetime apiKey = "123" secret = "123" timestamp = str(int(time.time())); authHeaderValue = "EAN APIKey=" + apiKey + ",Signature=" + hashlib.sha512(apiKey+secret+timestamp).hexdigest() + ",timestamp=" + timestamp
Ruby
require 'digest' apiKey="123" secret="123" timestamp = Time.now.to_i toBeHashed = "#{apiKey}#{secret}#{timestamp}" signature = Digest::SHA2.new(512).hexdigest(toBeHashed) authHeaderValue = "EAN APIKey=#{apiKey},Signature=#{signature},timestamp=#{timestamp}"
C#
String apiKey = "123"; String secret = "123"; TimeSpan epochTicks = new TimeSpan(new DateTime(1970, 1, 1).Ticks); TimeSpan unixTicks = new TimeSpan(DateTime.UtcNow.Ticks) - epochTicks; double unixTime = (int)unixTicks.TotalSeconds; var toBeHashed = apiKey + secret + unixTime; var bytes = System.Text.Encoding.UTF8.GetBytes(toBeHashed); using (var hash = System.Security.Cryptography.SHA512.Create()) { var hashedInputBytes = hash.ComputeHash(bytes); var hashedInputStringBuilder = new System.Text.StringBuilder(128); foreach (var b in hashedInputBytes) hashedInputStringBuilder.Append(b.ToString("X2")); var signature = hashedInputStringBuilder.ToString(); var authHeaderValue = "EAN APIKey=" + apiKey + ",Signature=" + signature +",timestamp=" + unixTime; }
Perl
use strict; use Crypt::Digest::SHA512 qw(sha512_hex); my $apiKey = '123'; my $secret = '123'; my $timestamp = time; my $sig = sha512_hex($apiKey . $secret . $timestamp); my $authHeaderValue = "EAN APIKey=".$apiKey.",Signature=".$sig.",timestamp=".$timestamp; print $authHeaderValue;
공유 암호 보호
귀하에게 제공된 공유 암호는 요청 데이터의 보안에 매우 중요합니다. 공유 암호를 비밀번호와 같이 처리하세요. 공개적으로 액세스 가능한 사이트 또는 앱 코드에 원시 값을 포함해서는 안 됩니다. EPS Rapid를 통합하도록 승인하면 공유 암호와 API 키가 제공됩니다.
EPS Home | EPS Portal Login | Expedia Partner Central | Advertise with Expedia | News | Privacy Policy | Cookie Policy
© 2020 Expedia, Inc. All Rights Reserved.