... | ... | @@ -4,98 +4,8 @@ The service api provides access to general services provided by the Passwords ap |
|
|
| Endpoint | Url | Methods | Description |
|
|
|
|------------------------------------------------------|-------------------------------------------------------------|------------|-------------------------------------------------------|
|
|
|
| [password](./Service-API/Generate-Password-API) | `/api/1.0/service/password` | GET & POST | Generates a password |
|
|
|
| [avatar](#the-avatar-endpoint) | `/api/1.0/service/avatar/{user}/{size}` | GET | Returns the avatar image for a user |
|
|
|
| [favicon](#the-favicon-endpoint) | `/api/1.0/service/favicon/{domain}/{size}` | GET | Returns a favicon image for a domain |
|
|
|
| [preview](#the-preview-endpoint) | `/api/1.0/service/preview/{domain}/{view}/{width}/{height}` | GET | Returns a preview image for a domain |
|
|
|
| [avatar](./Service-API/Avatar-API) | `/api/1.0/service/avatar/{user}/{size}` | GET | Returns the avatar image for a user |
|
|
|
| [favicon](./Service-API/Favicon-API) | `/api/1.0/service/favicon/{domain}/{size}` | GET | Returns a favicon image for a domain |
|
|
|
| [preview](./Service-API/Preview-API) | `/api/1.0/service/preview/{domain}/{view}/{width}/{height}` | GET | Returns a preview image for a domain |
|
|
|
| [hashes](./Service-API/Hashes-API) | `/service/hashes/{range}` | GET & POST | Returns breached hashes for the given range |
|
|
|
| [password-change](./Service-API/Password-Change-API) | `/api/1.0/service/password-change` | POST | Find the url of the password change page for a domain | |
|
|
|
|
|
|
|
|
# The avatar endpoint
|
|
|
The avatar endpoint returns a png avatar icon for the given user id.
|
|
|
|
|
|
#### URL
|
|
|
| Path | Method | Session required |
|
|
|
|-----------------------------------------|--------|------------------|
|
|
|
| `/api/1.0/service/avatar/{user}/{size}` | GET | no |
|
|
|
|
|
|
#### Arguments
|
|
|
| Arguments | Type | Default | Required | Description |
|
|
|
|-----------|--------|---------|----------|----------------------------------|
|
|
|
| user | string | - | yes | The user id |
|
|
|
| size | int | 32 | no | The size of the avatar in pixels |
|
|
|
|
|
|
#### Return value
|
|
|
The success status code is `200 Ok`.
|
|
|
This action returns a png image file on success
|
|
|
|
|
|
#### Notes
|
|
|
- If the user did not specify an avatar a default image will be generated
|
|
|
- The size must be a multiple of `8`
|
|
|
- The minimum size is `16` pixels
|
|
|
- The maximum size is `256` pixels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The favicon endpoint
|
|
|
The favicon endpoint returns a png favicon icon for the given domain.
|
|
|
|
|
|
#### URL
|
|
|
| Path | Method | Session required |
|
|
|
|--------------------------------------------|--------|------------------|
|
|
|
| `/api/1.0/service/favicon/{domain}/{size}` | GET | no |
|
|
|
|
|
|
#### Arguments
|
|
|
| Arguments | Type | Default | Required | Description |
|
|
|
|-----------|--------|---------|----------|-----------------------------------|
|
|
|
| domain | string | - | yes | The domain name |
|
|
|
| size | int | 32 | no | The size of the favicon in pixels |
|
|
|
|
|
|
#### Return value
|
|
|
The success status code is `200 Ok`.
|
|
|
This action returns a png image file on success
|
|
|
|
|
|
#### Notes
|
|
|
- If no favicon can be found a default image will be generated
|
|
|
- The size must be a multiple of `8`
|
|
|
- The minimum size is `16` pixels
|
|
|
- The maximum size is `256` pixels
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# The preview endpoint
|
|
|
The preview endpoint returns a jpeg preview image for the given domain.
|
|
|
|
|
|
#### URL
|
|
|
| Path | Method | Session required |
|
|
|
|-------------------------------------------------------------|--------|------------------|
|
|
|
| `/api/1.0/service/preview/{domain}/{view}/{width}/{height}` | GET | no |
|
|
|
|
|
|
#### Arguments
|
|
|
| Arguments | Type | Default | Required | Description |
|
|
|
|-----------|------------|-----------|----------|-------------------------------------------------------------|
|
|
|
| domain | string | - | yes | The domain name |
|
|
|
| view | string | "desktop" | no | Can be `desktop` or `mobile`. Sets device name / viewports. |
|
|
|
| width | string/int | 640 | no | The width of the resulting image |
|
|
|
| height | string/int | "360..." | no | The height of the resulting image |
|
|
|
|
|
|
#### Return value
|
|
|
The success status code is `200 Ok`.
|
|
|
This action returns a jpeg image file on success
|
|
|
|
|
|
#### Notes
|
|
|
- If no image can be created a default image will be used
|
|
|
- This action is known to be slow if the cache is empty
|
|
|
- The width and height must be a multiple of `10`
|
|
|
- The minimum width is `240` pixels
|
|
|
- The maximum width is `1280` pixels
|
|
|
- The minimum height is `240` pixels
|
|
|
- The maximum height is `1280` pixels
|
|
|
- If a width and height were specified, the image will be cropped to fill the area
|
|
|
- The width and height can be `0`. In this case, it is up to the api to set the optimal value
|
|
|
- You can specify a range for width and height by passing `SIZE...`, `SIZE...SIZE` or `...SIZE` where size is a number.
|
|
|
The left value will be the minimum and the right value the maximum.
|
|
|
The api will try to generate an image that fits the given values without cropping
|
|
|
- The resulting image will always have a minimum width and height of 240 pixels |
|
|
\ No newline at end of file |