Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Removed translated content for 'zh'
Sv translation
languageen

When attempting to access the BellaDati API, a client application needs to prove it has been authorized by a valid user. To do this, the application supplies an access token previously obtained during Authentication.

Authorization Header

The access token is passed in the HTTP authorization header of an API request. OAuth authorization requires parameters set in the following way:

  • Parameter names and values are encoded per parameter encoding (e.g. UTF-8).
  • Each parameter name is immediately followed by an ‘=’ character (ASCII code 61), a ‘”’ character (ASCII code 34), the parameter value (may be empty), and another ‘”’ character (ASCII code 34).
  • Parameters are separated by a comma character (ASCII code 44) and optional linear whitespace.

A valid header might look like this:

Code Block
Authorization: OAuth realm="https://service.belladati.com/",
                 oauth_consumer_key="myKey",
                 oauth_token="nd7an9eba41c",
                 oauth_timestamp="137131200",
                 oauth_nonce="4572616e48616d6d65724c61686176"

Sample Request / Response

Code Block
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myKey\", oauth_token=\"nd7an9eba41c\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\""  https://service.belladati.com/api/reports
Code Block
{
  "reports" : [
    {
      "id" : 12345,
      "description" : "This is a sample report.",
      "name" : "My Report",
      "owner" : "John Smith",
      "lastChange" : "Mon, 16 Apr 2012 10:17:26 GMT"
    }
  ],
  "offset" : 0,
  "size" : 100
}
Sv translation
languageja

BellaDati APIにアクセスしようとすると、クライアントアプリケーションは有効なユーザによって承認されたことを証明する必要があります。これを行うには、アプリケーションは以前に認証時に取得したアクセストークンを提供します。

認証ヘッダー

アクセストークンは、APIリクエストのHTTP認証ヘッダで渡されます。 OAuth認証は、以下のように設定したパラメータを必要とします:

  • パラメータの名前と値はパラメータごとにエンコードされます(UTF-8など)
  • 各パラメータ名は後ろで'=' (ASCII mã 61)、‘”’ character (ASCII code 34)、パラメータ値(空の場合もある)及び別の‘”’ character (ASCII code 34)を付けます
  • 各パラメータはカンマ文字(ASCII code 44)とオプションの線形空白で区切られます

有効なヘッダーは次のようになります。

Code Block
Authorization: OAuth realm="https://service.belladati.com/",
                 oauth_consumer_key="myKey",
                 oauth_token="nd7an9eba41c",
                 oauth_timestamp="137131200",
                 oauth_nonce="4572616e48616d6d65724c61686176"

サンプルリクエスト/レスポンス

Code Block
curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myKey\", oauth_token=\"nd7an9eba41c\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\""  https://service.belladati.com/api/reports
Code Block
{
  "reports" : [
    {
      "id" : 12345,
      "description" : "This is a sample report.",
      "name" : "My Report",
      "owner" : "John Smith",
      "lastChange" : "Mon, 16 Apr 2012 10:17:26 GMT"
    }
  ],
  "offset" : 0,
  "size" : 100
}