Omniauth_API_Document.md 2.8 KB

#Member Center API Document ##Hosts

##APIs ###Request Url

POST api/v3/verification/through_omniauth

###Request Parameters ####Required

  • client_id, string
  • client_secret, string
  • provider, string [facebook, google_oauth2, twitter, linkedin, qq_connect, wechat]
  • omniauth_token, string
  • omniauth_secret (only for twitter), string
  • bundle_id (only for twitter), string
  • open_id (only for qq_connect, wechat), string

####Optional

  • email, string
  • password, string

###Response ####Successful

{
  "code":200,
  "message":"ok",
  "data": {
    "current_time":"2017-07-14T08:15:46.120Z",
    "account":"don.shieh@gmail.com",
    "name":"謝東霖",
    "email":"don.shieh@gmail.com",
    "uuid":"cdff9f73-5ad0-4a32-b640-156c65bc9311",
    "unconfirmed_email":null,
    "is_developer":false,
    "confirmed":true,
    "bounced":false,
    "complainted":false,
    "created_at":"2017-07-13T08:35:04.558Z",
    "version_email_log_release_time":"2015-05-15T00:00:00.000Z",
    "profile_data":{
      "icon_info":{
        "icon_url":{
          "100":"https://s3.amazonaws.com/kdanfile-dev/user-icon/defaults/user_icon_1_100.png",
          "280":"https://s3.amazonaws.com/kdanfile-dev/user-icon/defaults/user_icon_1_280.png"
        },
        "icon_default_id":"icon1"
      },
      "display_name":null
    },
    "access_token": "9ce94b94044b01dba423c7746f1cbb369b344735ff69e01dfc8574246ddc6fc4",
    "token_type": "bearer",
    "expires_in": 172800,
    "refresh_token": "9147a9fd7ecee6c8cada39805429d81f95fda40a9232dd5267b432fb5a3cb581"
  }
}

####Fail

當第三方社群未提供email

{
  "code":4025,
  "message":"Email not available"
}

當提供的email與password不匹配

{
  "code":4026,
  "message":"Invalid password"
}

當用戶建立失敗導致無法產生token

{
  "code":400,
  "message":"Token generation failed"
}  

當第三方社群驗證失敗,或提供格式有誤

{
  "code":403,
  "message":"Authorication failed"
}

當client_id或client_secret不正確

{
  "code":403,
  "message":"Not authorized client"
}

###Request Url

POST api/v3/verification/email_existed ###Request Parameters ####Required

  • client_id, string
  • client_secret, string
  • email, string ###Response ####Successful { "code":200, "message":"ok", "data": true } or
{
  "code":200,
  "message":"ok",
  "data": false
}

####Fail 當伺服器無法回應

null