Get preset alphabet by digits

In order to get the character set of a preset alphabet known by name, the name of the alphabet MUST be sent as the first HTTP request path parameter. In order to also receive the number of tokens that can be generated with it, the number of digits of the token MAY be sent as the second HTTP request path parameter.

The character set of the chosen alphabet and, if requested, the number of available tokens are returned from the remote service in the JSON response body as data attributes chars resp. data attributes available together with other attribute–value pairs.

Request endpoint

GET SERVER:PORT/api/alphabets/DICE/5

Response status

200

Request headers

Accept:application/vnd.api+json
Content-Type:application/vnd.api+json
Session-Key:SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS

Response headers

Transfer-Encoding:chunked
Connection:keep-alive
Accept:application/vnd.api+json
Cache-Control:no-cache
Date:Tue, 19 Mar 2024 12:52:22 GMT
Content-Type:application/vnd.api+json
Server:nginx/1.25.4

Request body

# intentionally blank

Response body

{
    "links": {
        "self": "/api/alphabets/DICE/5"
    },
    "data": {
        "attributes": {
            "ascii": false,
            "length": 6,
            "bytes": 18,
            "parity": 0,
            "digits": "5",
            "reachable": "7776",
            "available": "7776",
            "chars": "⚀⚁⚂⚃⚄⚅"
        },
        "id": "DICE",
        "type": "alphabet"
    }
}

HTTPie example

$ http get SERVER:PORT/api/alphabets/DICE/5 Accept:application/vnd.api+json Content-Type:application/vnd.api+json Session-Key:SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS