Skip to content

Instantly share code, notes, and snippets.

@ptxmotc
Created January 4, 2018 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ptxmotc/8360ea1b77cd0d3b31cf76c1f66facdb to your computer and use it in GitHub Desktop.
Save ptxmotc/8360ea1b77cd0d3b31cf76c1f66facdb to your computer and use it in GitHub Desktop.
URI命名原則.md

【URI命名原則】

開放資料可透過URL方式取得資料。

Web API (application programming interface) 的表現方式,分為網站根目錄(App Root)、資源路徑(Resource Path)和查詢選項(Query Options)

  • 網站根目錄:應用服務的基本網址,主要組成為(Domain)網域名稱和(App)應用程式名稱,並且透過 HTTP 協定連結而形成服務的基本網址。

    Domain: ptx.transportdata.tw

    App : MOTC或PTX

  • 資源路徑:指定資源項目路徑名稱。

目錄結構 意義
Version(版本) 提供服務的版本號。目前提供 v1(第一版),若沒有輸入,則預設最新版本
Service(服務) 依據載具本身提供的服務,例如:鐵道:台鐵(TRA)、高鐵(THSRC),空運:航空(Aviation),道路:公車(Bus)等等。
Application(應用內容)) 根據每個服務而提不同的應用內容,例如:航空:航班資訊(FIDS)和機場資訊(Airport)等。
  • 查詢選項:指定欲取得資料的範圍或查詢的條件。

  • PTX API URI說明文件詳見連結請詳見連結

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment