# 3.3.7.Versioning the API

* Versioning
  * Creation and management of multiple release of a software
    * Not the same as version control: 開發者可以任意挑選不同版本的API

      ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0XF3yxaMCEROUMrB%2F201803178.jpg?generation=1586302965378728\&alt=media)
* Version format
  * 1.Use the date of release&#x20;
    * e.g., version = "10/1/2015", twilio
  * 2.major.minor&#x20;
    * e.g., version = "12.61", Facebook
  * 3.Single digit i.e., No minor version&#x20;
    * e.g., version = "12", Uber
* Version information
  * 1.HTTP header
    * e.g., x-myapi-version: 1.2
  * 2.Query parameter
    * e.g., /post?version=1.2, facebook
  * 3.URL
    * e.g., /v1/products, Uber
* Hybrid approach   &#x20;
  * [Stripe](https://stripe.com/)
    * Major change: <http://api.stripe.com/v1/charges>
    * Minor change: HTTP Header: "2016-07-06"
* API versioning mandatory
  * "v" followed by
  * Major version only
  * In the URL
* API Change strategy
  * quarterly release cycle
    * 開發者至少都有兩個版本可以使用

      ![](https://163116165-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M4M0G7tIs4o9F9vSrao%2F-M4M0IVB0ax0vs2ocz_r%2F-M4M0XF59NjebozNum_P%2F201803179.jpg?generation=1586302965931446\&alt=media)
  * Multiple version support key points
    * 1.Support at least 1 previous version for a period of time
      * e.g., 3 months
    * 2.Mark the previous version as deprecated
      * For new apps developers can access only the latest version
    * 3.Publish a roll out plan in advance
    * 4.Manage change log that shows the reason for new version
