1. Supported HTTP methods
Currently all API endpoints are supporting only the HTTP GET method. Accepting HTTP POST is work in progress.
Base API address |
---|
https://hipstapas.dev/api |
2. Generation options
Since currently only GET methods exists, all options should be set using query parameters.
Every endpoint supports a resultsCount query parameter, that controls how many items are returned at once.
Example: https://hipstapas.dev/api/?resultsCount=5
generates 5 phrases at once and returns a JSON array containing the newly generated strings.
For query parameters of type boolean that are not explicitely specified, true is always the default option.
3. Endpoints
3.1 Password - the default endpoint (/index)
The easiest way to generate a strong phrase is to call the base API address - call https://hipstapas.dev/api to generate a new password.
That's it! You just created a password using the default options (alphabet consists of small, capital, numbers and special charactes, min. length is 16 and max. length is 32 characters).
Options:
Parameter name | Type | Allowed values |
---|---|---|
alphabetSmall | Boolean | true|false |
If set to true the generation alphabet contains small characters: abcdefghijklmnopqrstuvwxyz | ||
alphabetCapital | Boolean | true|false |
If set to true the generation alphabet contains capital characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ | ||
alphabetNumber | Boolean | true|false |
If set to true the generation alphabet contains numbers: 0123456789 | ||
alphabetSpecial | Boolean | true|false |
If set to true the generation alphabet contains special characters: .,+-*/!?;:{}()[]%$&~#@| | ||
lengthMin | Number | 1..2048 |
Defines the minimal length of the generated phrase | ||
lengthMax | Number | 1..2048 |
Defines the maximal length of the generated phrase | ||
resultsCount | Number | 1..100 |
Defines how many results should be generated at once |
- generate 5 phrases at once
- where each phrase is exactly 5 characters long
- excluding special and capital characters (in other words - using only small characters and numbers)
3.2 Generating UUID (/uuid)
Call https://hipstapas.dev/api/uuid to generate a new (version 4) uuid. That's it! Options:
Parameter name | Type | Allowed values |
---|---|---|
resultsCount | Number | 1..100 |
Defines how many results should be generated at once |
3.3 EFF wordlist (/wordlist)
Call https://hipstapas.dev/api/wordlist to create a passphrase from 6 words (as described and suggested by EFF https://www.eff.org/de/dice). This is the default option. The count of the words per passphrase can be set between 1 and 50 using the query parameter words, e.g. https://hipstapas.dev/api/wordlist/?words=3. Options:
Parameter name | Type | Allowed values |
---|---|---|
words | Number | 1..50 |
Defines the count of the words per passphrase | ||
resultsCount | Number | 1..100 |
Defines how many results should be generated at once |
3.4 Random number (/random)
Call https://hipstapas.dev/api/random to create a random number between 1 and 1048576. The default values are:
- min=1
- max=1
- sort=false
- noDuplicates=false
- resultsCount=1
Parameter name | Type | Allowed values |
---|---|---|
min | Number | 1..1048576 |
Defines the lower bound of the number generator | ||
max | Number | 1..1048576 |
Defines the upper bound of the number generator | ||
sort | Boolean | true|false |
Sorts the generated number sequence | ||
noDuplicates | Boolean | true|false |
The generated number sequence should contain only unique numbers | ||
resultsCount | Number | 1..100 |
Defines how many results should be generated at once |
4. Custom policy
WIP
5. API definition (OpenAPI / Swagger)
The hipstapas API definition: