Fedex Logo
Developer Portal

API Authorization

소개

FedEx API는 FedEx 리소스를 사용하여 API 요청을 인증하는 OAuth 2.0(Bearer Token) 인증 방식을 지원합니다. FedEx 리소스에 대한 사용자의 액세스를 인증하고 승인하려면 이 OAuth 액세스 토큰이 60분마다 재생성되고 각 API 트랜잭션과 함께 제공되어야 합니다.

인증 API 세부정보

이 API는 API 요청을 승인하는 데 사용되며, FedEx 리소스를 인증하는 데 필요합니다. 다음 섹션에서는 이 API의 필수 구성 요소에 대해 설명합니다.

FedEx Developer Portal에 등록할 때 FedEx는 프로젝트의 API 요청을 인증하기 위한 클라이언트 ID(API 키) 및 클라이언트 시크릿(시크릿 키) 조합을 제공합니다. 회사에 속한 각 프로젝트는 API 자격 증명이라고 부르는 클라이언트 ID 및 클라이언트 시크릿 조합과 연결됩니다.

참고: 고객(Internal, Compatible, Proprietary Parent Child, Integrator)은 FedEx 담당자에게 연락해 API 및 시크릿 키를 받을 수 있습니다.

한층 강화된 보안을 위해 FedEx® 고객(Internal, Compatible, Proprietary Parent Child, Integrator)은 API 키 및 시크릿 키 외에 하위 키(고객 시크릿) 및 하위 시크릿(고객 비밀번호)을 전송해 OAuth 토큰을 생성할 수 있습니다. 이 토큰은 API 요청 시마다 인증에 사용됩니다.

시크릿 키를 잊은 경우 FedEx Developer Portal의 프로젝트 페이지에서 다시 만들 수 있습니다.

참고: 새 키를 만들면 응용 프로그램에서 코드 변경이 이루어집니다.

이 문서의 중요 정보:

  • API 키인 클라이언트 키
  • 시크릿 키인 클라이언트 키
  • 고객 키인 하위 키
  • 고객 비밀번호인 하위 시크릿

API 자격 증명은 다음과 같은 목적으로 사용됩니다.

  • API를 호출하는 프로젝트를 식별합니다.
  • 프로젝트에서 활성화된 API에 대한 액세스를 승인합니다.

API 자격 증명을 얻는 방법

FedEx Developer Portal에 입력된 정보를 기준으로 자격 증명이 생성됩니다.

  • 클라이언트 ID – FedEx Developer Portal에 프로젝트가 생성되면 API 키(클라이언트 ID)가 생성됩니다. 프로젝트 개요 페이지에서 프로젝트와 연결된 API 키도 볼 수 있습니다.
  • 클라이언트 시크릿 – FedEx Developer Portal에 프로젝트가 생성되면 확인 페이지에 시크릿 키(클라이언트 시크릿)가 표시됩니다. 필요한 경우 프로젝트 개요 페이지에서 시크릿 키를 다시 생성할 수도 있습니다.

참고: FedEx® 고객(Internal, Compatible, Proprietary Parent Child, Integrator)의 경우 OAuth 토큰을 생성하려면 API 키 및 시크릿 키 외에 하위 키(고객 시크릿) 및 하위 시크릿(고객 비밀번호)를 전송해야 합니다. 하위 키 및 하위 시크릿을 받는 방법은 자격 증명 등록 API를 참조하세요.

인증 API 활용 방법

API 인증

FedEx Developer Portal에 API 자격 증명을 저장했으면 OAuth 엔드포인트를 사용해 각 API 트랜잭션에서 자격 증명으로 사용할 액세스 토큰을 받습니다.

OAuth 요청과 관련된 필수 입력 정보는 다음과 같습니다.

  • grant_type – 고객 유형입니다. (유효한 값: client_credentials, csp_credentials, client_pc_credentials)
  • client_id – 프로젝트 API 키를 참조하십시오.
  • client_secret – 프로젝트 API 시크릿 키를 참조하십시오.

FedEx® Internal, Compatible, Proprietary Parent Child, Integrator 고객의 경우 아래 추가 입력 정보를 전송해야 합니다.

  • child_id – 자격 증명 등록 API 요청을 통해 반환된 고객 키입니다.
  • child_secret – 자격 증명 등록 API 요청을 통해 반환된 고객 비밀번호입니다.

이 요청의 결과로 다음이 반환됩니다.

  • access_token – API 트랜잭션에서 사용되어야 하는 암호화된 OAuth 토큰입니다.
  • token_type – 토큰의 유형입니다. 이번의 경우 bearer authentication입니다.
  • expires_in – 밀리세컨드 단위의 토큰 만료 시간입니다. 표준 토큰 만료 시간은 1시간입니다.
  • Scope – 사용자에게 제공된 승인 범위입니다.

요청:

POST /oauth/token HTTP/1.1
grant_type= client_credentials&client_id=클라이언트 ID&client_secret=시크릿

응답:

{ ″access_token″: ″eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX……..″,
″token_type″: ″bearer″,
″expires_in″: 3600,
″scope″: ″CXS″
}

FedEx® Internal, Compatible, Integrator 고객에 대한 요청:

POST /oauth/token HTTP/1.1
grant_type= csp_credentials&client_id=클라이언트 ID&client_secret= 클라이언트 시크릿&child_key=Child key&child_secret=하위 시크릿

응답:

{ ″access_token″: ″eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX……..″,
″token_type″: ″bearer″,
″expires_in″: 3600,
″scope″: ″CXS″
}

FedEx® Proprietary Parent Child 고객에 대한 요청:

POST /oauth/token HTTP/1.1
grant_type= client_pc_credentials&client_id=Client ID&client_secret= Client secret&child_key=Child key&child_secret=Child Secret

응답:

{ ″access_token″: ″eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX……..″,
″token_type″: ″bearer″,
″expires_in″: 3600,
″scope″: ″CXS″
}

참고: 액세스 토큰은 1시간 후에 만료됩니다. oauth/토큰 엔드포인트에 대한 POST 요청을 사용해 다시 생성할 수 있습니다.

API Authorization (1.0)

API Authorization

Use this endpoint to request the OAuth token (bearer token) to authorize your application to access FedEx resources. You can pass this bearer token in your subsequent individual FedEx API endpoint requests.
Note: FedEx APIs do not support Cross-Origin Resource Sharing (CORS) mechanism.

header Parameters
content-type
required
string
Example: application/x-www-form-urlencoded

This is used to indicate the media type of the resource. The media type is a string sent along with the file indicating format of the file.
Example: application/x-www-form-urlencoded

Request Body schema: application/x-www-form-urlencoded
grant_type
required
string

Specify Type of customer requesting the Oauth token.
Valid Values: client_credentials, csp_credentials, client_pc_credentials
Note:
client_credentials - should be used for customers, Integrators, and brand new Compatible Provider customers who are yet to unboard child accounts.
csp_credentials - should be used for Integrators, and Compatible Provider customers with existing child accounts.
client_pc_credentials – should be used for Proprietary Parent Child customers.

client_id
required
string

Specify the Client ID also known as API Key received during FedEx Developer portal registration.
Example: XXXX-XXX-XXXX-XXX

client_secret
required
string

Specify the Client secret also known as Secret Key received during FedEx Developer portal registration.
Example: XXXX-XXX-XXXX-XXX

child_Key
string

Specify the Client ID also known as Customer Key. This element is used as a login credential for an Integrator customer, Compatible customer or a Proprietary Parent Child customer to access the application on behalf of their customer.
Example: XXXX-XXX-XXXX-XXX
Note: This element should be used by Integrator, Compatible and Proprietary Parent Child customers.

child_secret
string

Specify the Client secret also known as Customer Secret. This element is used as a login credential for an Integrator customer, Compatible customer or a Proprietary Parent Child customer to access the application on behalf of their customer.
Example: XXXX-XXX-XXXX-XXX
Note: This element should be used by Integrator, Compatible and Proprietary Parent Child customers.

Responses

200

Success

401

Unauthorized

500

Failure

503

Service Unavailable

post /oauth/token

Sandbox Server

https://apis-sandbox.fedex.com/oauth/token

Production Server

https://apis.fedex.com/oauth/token

Request samples

Content type
application/x-www-form-urlencoded
Example
Copy
grant_type=client_credentials&client_id=Your_client_ID&client_secret=Your_secret

Response samples

Content type
application/json
Copy
Expand all Collapse all
{
  • "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpX……",
  • "token_type": "bearer",
  • "expires_in": 3600,
  • "scope": "CXS"
}
CLOSE

Response

Copy