Since the version 1.4 the element “friendly_separator” is now “separator”
Body Json
You need to send this body, if you omit any of the elements you will get an error.
{
"number_of_words":"5",
"number_of_numbers":"2",
"separator":"0",
"language":"en"
}
You need to set this 4 elements :
- number_of_words
- number_of_numbers
- separator
- language
number_of_words This is literraly the number of words you will get.
number_of_numbers It’s the number of digits you’ll have in your number.
separator
- If set to 0 you will get only user friendly separator from this list : [-_:+?;!,]
- If set to 1 you will get anything present in string.punctuation : [!"#$%&'()*+, -./:;<=>?@[]^_`{|}~]
- If set to 2 you will get separator from this list : [-_]
If set to 1 you can get any ASCII characters which are considered punctuation characters in the C locale.
language You can choose the dictionary from which the words will be chosen. Valid options are
- en : more than 370000 English words
- fr : more than 330000 French words
- fr_simple : more than 22000 French words
- it : more than 88300 Italian words
- de : more than 166100 German words
- es : more than 174800 Spanish words
Endpoint v1/elements
curl --request POST \
--url http://[server]:[port]/v1/elements \
--header 'content-type: application/json' \
--data '{
"number_of_words":"5",
"number_of_numbers":"2",
"separator":"0",
"language":"fr_simple"
}'
result:
{
"status": "ok",
"result": [
",",
"07",
"dissoute",
"SNECMA"
]
}
Endpoint v1/password
curl --request POST \
--url http://[server]:[port]/v1/password \
--header 'content-type: application/json' \
--data '{
"number_of_words":"2",
"number_of_numbers":"4",
"separator":"1",
"language":"fr_simple"
}'
result:
{
"status": "ok",
"result": "MartialLudwigSubie[3048"
}
Endpoint v1/access_key
curl --request GET \
--url http://[server]:[port]/v1/access_key
result:
{
"status": "ok",
"result": [
{
"access_key": "PFP5NIM1IJI69JZYCDDD",
"secret_key": "LqIDaoFWuF0IHGuHpJXjXOCz42FScim3pfX7XzRf"
}
]
}
Endpoint v2/elements
curl --request POST \
--url http://[server]:[port]/v2/elements \
--header 'content-type: application/json' \
--data '{
"number_of_words":"5",
"number_of_numbers":"2",
"separator":"0",
"language":"fr_simple"
}'
result:
{
"status": "ok",
"result": [
{
"separator": ":",
"number": "85",
"words": [
"fusion",
"Bebes",
"conjoints",
"petite",
"analytiquement"
]
}
]
}
Endpoint /checkhealth
curl --url http://[server]:[port]/checkhealth
result:
{
"status": "ok"
}
Endpoint /version
curl --url http://[server]:[port]/version
result:
1.4