Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-06-06 13:50:34 +0300
committerRémy Coutable <remy@rymai.me>2018-06-06 13:50:34 +0300
commitf4b03f0992d39db9f9f77798cb285d732c352074 (patch)
tree51bc0ace569b24a49910c02e0d918c90317f9685 /doc
parent71242199a2c4a8130e02d51bc97cb505f6768e52 (diff)
parentc8f0e4b5da0c9d578035e74b524f5adcb80efcf6 (diff)
Merge branch '45821-avatar_api' into 'master'
Add Avatar API Closes #45821 See merge request gitlab-org/gitlab-ce!19121
Diffstat (limited to 'doc')
-rw-r--r--doc/api/avatar.md33
1 files changed, 33 insertions, 0 deletions
diff --git a/doc/api/avatar.md b/doc/api/avatar.md
new file mode 100644
index 00000000000..7faed893066
--- /dev/null
+++ b/doc/api/avatar.md
@@ -0,0 +1,33 @@
+# Avatar API
+
+> [Introduced][ce-19121] in GitLab 11.0
+
+## Get a single avatar URL
+
+Get a single avatar URL for a given email addres. If user with matching public
+email address is not found, results from external avatar services are returned.
+This endpoint can be accessed without authentication. In case public visibility
+is restricted, response will be `403 Forbidden` when unauthenticated.
+
+```
+GET /avatar?email=admin@example.com
+```
+
+| Attribute | Type | Required | Description |
+| --------- | ------- | -------- | --------------------- |
+| `email` | string | yes | Public email address of the user |
+| `size` | integer | no | Single pixel dimension (since images are squares). Only used for avatar lookups at `Gravatar` or at the configured `Libravatar` server |
+
+```bash
+curl https://gitlab.example.com/api/v4/avatar?email=admin@example.com
+```
+
+Example response:
+
+```json
+{
+ "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80\u0026d=identicon"
+}
+```
+
+[ce-19121]: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/19121