github.com/netbrain/docker@v1.9.0-rc2/docs/reference/api/docker_io_accounts_api.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "docker.io accounts API"
     4  description = "API Documentation for docker.io accounts."
     5  keywords = ["API, Docker, accounts, REST,  documentation"]
     6  [menu.main]
     7  parent = "mn_reference"
     8  +++
     9  <![end-metadata]-->
    10  
    11  # docker.io accounts API
    12  
    13  ## Get a single user
    14  
    15  `GET /api/v1.1/users/:username/`
    16  
    17  Get profile info for the specified user.
    18  
    19  Parameters:
    20  
    21  -   **username** – username of the user whose profile info is being
    22          requested.
    23  
    24  Request Headers:
    25  
    26  -   **Authorization** – required authentication credentials of
    27          either type HTTP Basic or OAuth Bearer Token.
    28  
    29  Status Codes:
    30  
    31  -   **200** – success, user data returned.
    32  -   **401** – authentication error.
    33  -   **403** – permission error, authenticated user must be the user
    34          whose data is being requested, OAuth access tokens must have
    35          `profile_read` scope.
    36  -   **404** – the specified username does not exist.
    37  
    38  **Example request**:
    39  
    40          GET /api/v1.1/users/janedoe/ HTTP/1.1
    41          Host: www.docker.io
    42          Accept: application/json
    43          Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
    44  
    45  **Example response**:
    46  
    47          HTTP/1.1 200 OK
    48          Content-Type: application/json
    49  
    50          {
    51              "id": 2,
    52              "username": "janedoe",
    53              "url": "https://www.docker.io/api/v1.1/users/janedoe/",
    54              "date_joined": "2014-02-12T17:58:01.431312Z",
    55              "type": "User",
    56              "full_name": "Jane Doe",
    57              "location": "San Francisco, CA",
    58              "company": "Success, Inc.",
    59              "profile_url": "https://docker.io/",
    60              "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
    61              "email": "jane.doe@example.com",
    62              "is_active": true
    63          }
    64  
    65  ## Update a single user
    66  
    67  `PATCH /api/v1.1/users/:username/`
    68  
    69  Update profile info for the specified user.
    70  
    71  Parameters:
    72  
    73  -   **username** – username of the user whose profile info is being
    74          updated.
    75  
    76  Json Parameters:
    77  
    78  -   **full_name** (*string*) – (optional) the new name of the user.
    79  -   **location** (*string*) – (optional) the new location.
    80  -   **company** (*string*) – (optional) the new company of the user.
    81  -   **profile_url** (*string*) – (optional) the new profile url.
    82  -   **gravatar_email** (*string*) – (optional) the new Gravatar
    83          email address.
    84  
    85  Request Headers:
    86  
    87  -   **Authorization** – required authentication credentials of
    88          either type HTTP Basic or OAuth Bearer Token.
    89  -   **Content-Type** – MIME Type of post data. JSON, url-encoded
    90          form data, etc.
    91  
    92  Status Codes:
    93  
    94  -   **200** – success, user data updated.
    95  -   **400** – post data validation error.
    96  -   **401** – authentication error.
    97  -   **403** – permission error, authenticated user must be the user
    98          whose data is being updated, OAuth access tokens must have
    99          `profile_write` scope.
   100  -   **404** – the specified username does not exist.
   101  
   102  **Example request**:
   103  
   104          PATCH /api/v1.1/users/janedoe/ HTTP/1.1
   105          Host: www.docker.io
   106          Accept: application/json
   107          Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
   108  
   109          {
   110              "location": "Private Island",
   111              "profile_url": "http://janedoe.com/",
   112              "company": "Retired",
   113          }
   114  
   115  **Example response**:
   116  
   117          HTTP/1.1 200 OK
   118          Content-Type: application/json
   119  
   120          {
   121              "id": 2,
   122              "username": "janedoe",
   123              "url": "https://www.docker.io/api/v1.1/users/janedoe/",
   124              "date_joined": "2014-02-12T17:58:01.431312Z",
   125              "type": "User",
   126              "full_name": "Jane Doe",
   127              "location": "Private Island",
   128              "company": "Retired",
   129              "profile_url": "http://janedoe.com/",
   130              "gravatar_url": "https://secure.gravatar.com/avatar/0212b397124be4acd4e7dea9aa357.jpg?s=80&r=g&d=mm"
   131              "email": "jane.doe@example.com",
   132              "is_active": true
   133          }
   134  
   135  ## List email addresses for a user
   136  
   137  `GET /api/v1.1/users/:username/emails/`
   138  
   139  List email info for the specified user.
   140  
   141  Parameters:
   142  
   143  -   **username** – username of the user whose profile info is being
   144          updated.
   145  
   146  Request Headers:
   147  
   148  -   **Authorization** – required authentication credentials of
   149          either type HTTP Basic or OAuth Bearer Token
   150  
   151  Status Codes:
   152  
   153  -   **200** – success, user data updated.
   154  -   **401** – authentication error.
   155  -   **403** – permission error, authenticated user must be the user
   156          whose data is being requested, OAuth access tokens must have
   157          `email_read` scope.
   158  -   **404** – the specified username does not exist.
   159  
   160  **Example request**:
   161  
   162          GET /api/v1.1/users/janedoe/emails/ HTTP/1.1
   163          Host: www.docker.io
   164          Accept: application/json
   165          Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
   166  
   167  **Example response**:
   168  
   169          HTTP/1.1 200 OK
   170          Content-Type: application/json
   171  
   172          [
   173              {
   174                  "email": "jane.doe@example.com",
   175                  "verified": true,
   176                  "primary": true
   177              }
   178          ]
   179  
   180  ## Add email address for a user
   181  
   182  `POST /api/v1.1/users/:username/emails/`
   183  
   184  Add a new email address to the specified user's account. The email
   185  address must be verified separately, a confirmation email is not
   186  automatically sent.
   187  
   188  Json Parameters:
   189  
   190  -   **email** (*string*) – email address to be added.
   191  
   192  Request Headers:
   193  
   194  -   **Authorization** – required authentication credentials of
   195          either type HTTP Basic or OAuth Bearer Token.
   196  -   **Content-Type** – MIME Type of post data. JSON, url-encoded
   197          form data, etc.
   198  
   199  Status Codes:
   200  
   201  -   **201** – success, new email added.
   202  -   **400** – data validation error.
   203  -   **401** – authentication error.
   204  -   **403** – permission error, authenticated user must be the user
   205          whose data is being requested, OAuth access tokens must have
   206          `email_write` scope.
   207  -   **404** – the specified username does not exist.
   208  
   209  **Example request**:
   210  
   211          POST /api/v1.1/users/janedoe/emails/ HTTP/1.1
   212          Host: www.docker.io
   213          Accept: application/json
   214          Content-Type: application/json
   215          Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
   216  
   217          {
   218              "email": "jane.doe+other@example.com"
   219          }
   220  
   221  **Example response**:
   222  
   223          HTTP/1.1 201 Created
   224          Content-Type: application/json
   225  
   226          {
   227              "email": "jane.doe+other@example.com",
   228              "verified": false,
   229              "primary": false
   230          }
   231  
   232  ## Delete email address for a user
   233  
   234  `DELETE /api/v1.1/users/:username/emails/`
   235  
   236  Delete an email address from the specified user's account. You
   237  cannot delete a user's primary email address.
   238  
   239  Json Parameters:
   240  
   241  -   **email** (*string*) – email address to be deleted.
   242  
   243  Request Headers:
   244  
   245  -   **Authorization** – required authentication credentials of
   246          either type HTTP Basic or OAuth Bearer Token.
   247  -   **Content-Type** – MIME Type of post data. JSON, url-encoded
   248          form data, etc.
   249  
   250  Status Codes:
   251  
   252  -   **204** – success, email address removed.
   253  -   **400** – validation error.
   254  -   **401** – authentication error.
   255  -   **403** – permission error, authenticated user must be the user
   256          whose data is being requested, OAuth access tokens must have
   257          `email_write` scope.
   258  -   **404** – the specified username or email address does not
   259          exist.
   260  
   261  **Example request**:
   262  
   263          DELETE /api/v1.1/users/janedoe/emails/ HTTP/1.1
   264          Host: www.docker.io
   265          Accept: application/json
   266          Content-Type: application/json
   267          Authorization: Bearer zAy0BxC1wDv2EuF3tGs4HrI6qJp6KoL7nM
   268  
   269          {
   270              "email": "jane.doe+other@example.com"
   271          }
   272  
   273  **Example response**:
   274  
   275          HTTP/1.1 204 NO CONTENT
   276          Content-Length: 0