Passphrase API
Description
Generate a passphrase string based on your input parameters.
Endpoint
> GET https://api.jsonrepo.com/v1/compute/generator/passphrase
Headers
Field | Description |
---|---|
api_key | Required Your API Key |
Parameters
Field | Type | Description |
---|---|---|
size | Integer | Optional Number of words in the Passphrase Default: 8 Min: 3 Max: 30 |
capitalize | String | Optional Specify if you want all words capitalized Default: true Set to false to disable |
delimiter | String | Optional Specify the delimiter Default: "-" Delimiter can be up to 10 characters long |
About this endpoint:
The words generated by this functions are taken from a Lorem corpus. Reason for this choice is because non-english words are typically less targeted by dictionary attacks which increases the overall security of the output.
Response
A successful request will result in a populated payload
field with the expected output.
A failed request will result in an error output as detailed in Error Rules. If the endpoint validation fails due to missing, badly formatted or invalid parameters, the endpoint will return HTTP code 400
along with a message
detailing the error.
See the examples section for more information.
Request
- Curl
// Generate a 5 word passphrase with "#" as delimiter
curl -G \
https://api.jsonrepo.com/v1/compute/generator/passphrase \
-H "api_key: {YOUR_API_KEY_HERE}" \
--data-urlencode "size=5" \
--data-urlencode "delimiter=#"
Success Response
{
"http_code": 200,
"http_message": "Ok",
"message": "Successful execution",
"payload": {
"passphrase": "Consequatur#Repudiandae#Vel#Quaerat#Autem"
}
}
Error Response Examples
// Request with badly formatted `size` parameter
{
"http_code": 400,
"http_message": "Bad Request",
"message": "Malformed request: `size` parameter must be between 3 (min) and 30 (max). Default is 8.",
"payload": []
}
// Request with an oversized `delimiter`
{
"http_code": 400,
"http_message": "Bad Request",
"message": "Malformed request: `delimiter` cannot be more than 10 characters long.",
"payload": []
}