github.com/feiyang21687/docker@v1.5.0/docs/sources/reference/api/docker_io_accounts_api.md (about)

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