This section describes RANDOM.ORG's Signed API, which together with the Basic API constitutes the Core API. The Signed API is intended for applications that need to support non-repudiation, and its methods produce digitally signed series of true random values, generated specifically for your client. The digital signatures mean that the values can be proved to originate from RANDOM.ORG.
In the Signed API, a signature is a SHA-512 digest
of the JSON representation of a random object, which
has been signed with RANDOM.ORG's private key.
Given a random object and its signature,
anyone can verify the signature against RANDOM.ORG's
public key to confirm that the numbers
are authentic. To do this, the client should JSON-encode the
random object, then compute the SHA-512 digest and
verify the signature against it. While a client is free to use
its own signature verification algorithm, it can also use the
verifySignature method described here.
The Signed API also stores the values generated with the methods
for a minimum of one year. This allows you to retrieve values that
were generated but may not have been delivered to your client due
to network failures, etc. The getResult method is
used for this purpose.
The URL for invoking the Signed API is:
https://api.random.org/json-rpc/3/invoke
createTicketslistTicketsgetTicketticketId was added to the
following methods:
generateSignedIntegersgenerateSignedIntegerSequencesgenerateSignedDecimalFractionsgenerateSignedGaussiansgenerateSignedStringsgenerateSignedUUIDsgenerateSignedBlobsticketData was added to
random objects returned by the following methods:
generateSignedIntegersgenerateSignedIntegerSequencesgenerateSignedDecimalFractionsgenerateSignedGaussiansgenerateSignedStringsgenerateSignedUUIDsgenerateSignedBlobsgenerateSignedIntegers (method)
This method generates true random integers within a user-defined
range. Your client must set the method property of
its JSON-RPC request object to generateSignedIntegers.
The request must also contain an id member, which
will be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynminmax
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
replacement (default value true)true) will cause the
numbers to be picked with replacement, i.e., the resulting
numbers may contain duplicate values (like a series of dice
rolls). If you want the numbers picked to be unique (like
raffle tickets drawn from a container), set this value to
false.
base (default value 10)2, 8, 10
and 16. This affects the JSON types of the
data property included in the response, as discussed
below.
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the numbers were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
n, min, max,
replacement, base
params
object. Values that are optional and did not appear in the
request will appear in the response with the default values.
The reason these are included in the response is to allow them
to be signed by RANDOM.ORG.
database 10 (or did
not specify a base and therefore defaults to 10),
the elements in the array will be integers. Because JSON (according
to RFC4627)
only allows numbers to be written as decimal, the numbers will
be typed as strings if a different base than
10 was specified in the request. Numbers in any
base other than 10 will be padded with leading zeros up to the
width required to display the chosen range.
licensedata can be used.
The API key owner selects a license for each API key created,
which affects this field in the responses generated for this
API key. For example, an API key could be licensed for
non-profit use only, or for commercial gambling up to a
certain prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response
with the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the corresponding
hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature properties,
such that they can be shared publically or with auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests three numbers in the [1,6] range. The
replacement parameter is set to true,
which means the numbers will be picked with replacement, i.e.,
can contain duplicate values. This makes them suitable for use as
dice rolls.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 3,
"min": 1,
"max": 6,
"replacement": true
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"min": 1,
"max": 6,
"replacement": true,
"base": 10,
"data": [
2, 5, 4
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 14:29:38Z",
"serialNumber": 6241
},
"signature": "Nxdv64PXf6GUe+bCLctc+iAo48MszJqBnuyRP7YWfefXLOxYBfBugG4mUw/06A4GPo9k7sim4dmhnjFG13kPslbn2fIpUMFCy+ZNgZWriaVaq0gevQei2ikeT34ed2IpLdzqe3uCgPXP64OMsx0cdzZIH5lJOPeMDpzYA7wTvve+MXP3z2YP5mWF5EafVM+ma/mlU2w1bQrVvO/38SJZx/m4OAy05PMW9DHyW68+eQtoDfQo6SerIP+Gbb0A9XaFS2tuGMPqmX/DEse07i6ReNUdEHssdWrZvvX++wmzbERA4bbC2n5R4dc5qLsxYYjWZQx5DM/zzhnZ1MLXdvSCukhtJA6Vp6gFLy3WxkbQ+ciy0IaxagCV1D1hAOk26zc8xVwk/VASzp9yb1AZJafj24axbbzTHQX41aEpaRvHhnq6/7RGgVAb9gVoa5QFk/yCIw5oBfhT5ATe4yqRdx5vRduAsCpISA/cp79aZp2P6sss0yVUWJmE7oGG+3uGqSIog2QVBWyLu935jFEnj+lqilyUI5xXN8S5F+V6pZI/lw5wf8IlwXi5nxBKWyat3zrdWjbV7tumilQwBOIr9yh3gSBzrT1c85n0DEAmMQLZSi92ah2OvtMrDH+58P2ME0KeDLB0VMq46k/gl9L4f9ccLBcPOmjmqG/lzLYmgqMvDB8=",
"bitsUsed": 8,
"bitsLeft": 249796,
"requestsLeft": 996,
"advisoryDelay": 2760
},
"id": 26821
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random numbers. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without disclosing
its apiKey. The n, min,
max and replacement parameters from the
request are included too. The base and userData
properties have been added, even though they did not appear in the
request. The data array within the result
contains the true random numbers produced, and the license
describes how the numbers can be used. The ticketData
property has been added with its default value of null
because ticketId did not appear in the request. The
completionTime specifies UTC time zone (‘Zulu
time’) by the letter ‘Z’ after the clock time.
The serialNumber indicates that this is the 6241st
request to have been completed with the apiKey in
question.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. Through the other
fields in the result, RANDOM.ORG also advises how many true random bits were used to satisfy the
request and how many bits and requests are left in the client's
quota. The service advises the client when it can issue the next
request, after a short delay.
The following requests 52 numbers in the [1,52] range. The
replacement parameter is set to false,
meaning the numbers will be picked without replacement, i.e.,
duplicates will not occur. This makes them suitable to shuffle a
deck of cards. The client also includes an object in the
userData property. The service does not perform
any operations on this object, but simply includes it along with
the signed random data that is returned to the client in the response.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"userData": {
"myHashType": "md5",
"myHashValue": "c4ec4ba28cbe8390c2f846bf589e538a"
}
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"data": [
32, 18, 49, 22, 5, 41, 26, 10, 24, 40, 46, 1, 20, 6, 37, 30, 2, 42, 31, 38, 47, 25, 11, 19, 7, 16, 48, 3, 14, 15, 9, 51, 39, 23, 21, 12, 27, 4, 33, 17, 44, 45, 8, 35, 36, 34, 52, 29, 50, 43, 13, 28
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": {
"myHashType": "md5",
"myHashValue": "c4ec4ba28cbe8390c2f846bf589e538a"
},
"ticketData": null,
"completionTime": "2021-03-25 14:31:55Z",
"serialNumber": 6242
},
"signature": "7OAGAZcY4OkHJUD84vmFQXDSFykd9Td55AHubBHbQzGuJ5+sPSPj5HzZK0qMzxI8L+BuQbz1ayIYxlKP3heni125XFe6tB5L24qNgA1r5cAZVaXkU2BTsockio0s4YYDdIVz8chLA6cYqu03AjzuI8Q7G2QSLbdOdQYKz27nvJsFgf9ER5MawgMH4E4VTSGG6roVJMN0ANiHndoRPMaIzKgve4oPnZDoG5Tj/hK+gGohSamrf1XnpG3muM/ZsOsUxVPmh4TaJ/tjSvilkEoUphMsYzXvq/qiVBXUoOLKC0aks/oURveQnfFQjSLj9Bc4lj99UZzJWHN8Aotaz2MysUDuf65axyEu8ulJOJkypB47T7mT00jk+STQ1aYI6JwS9NsQ7qPXaJtDJRMhUXdj3VFM7xe8HMtTTEoWq08bb22qKDJLhOLrl3NO4A+ALLsJjdjhpJvR09ezaUC9JJCG18ChNM+8wLvyvpF7jQxl5V24/nrSLHqeS3m64r9Ip5BG8F/UADwRUdiFhbewGJZTjWfOBWq55WcQRQzYQacOQo5R1Pub5bBWiobdkLeMdLdCey8MjptGymYdJGBWIEBpuF/97Y494GYJdtqOhT75GRR+/mxj7pnd9ghl3i0E3825uZO3fqoCpKAp2vASzo/GG6sfc5OhErex9uEVWbnMz6M=",
"bitsUsed": 296,
"bitsLeft": 249500,
"requestsLeft": 995,
"advisoryDelay": 2840
},
"id": 26821
}
The method, n, min,
max, replacement and base
parameters are the same that appeared in the request. The
hashedApiKey allows the client to share the full
contents of the random and signature
objects with third parties without disclosing its apiKey.
The random object contains the true random numbers (in
the data array) produced. The service advises exactly
when the request was completed, and that the values are licensed for
testing and development only. The object that the client passed in
the userData parameter is included unchanged in the
response, and the ticketData property has been added
with its default value of null because ticketId
did not appear in the request. The serial number indicates that this
is the 6242nd request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests a single value in the [0,36] range, for
example to decide a spin in European roulette. The client specifies
a value of false for the replacement
parameter, but this has no effect since we're only generating a
single number. The optional base parameter is used to
indicate that the client wishes the numbers to be returned in
decimal form.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. In this example, we specify a ticket that was created
with showResult set to false. This means
the random values returned in response to the request will not be
included in later responses by getTicket.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"userData": null,
"ticketId": "b09671d3a527cb5d"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"data": [
22
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "b09671d3a527cb5d",
"previousTicketId": null,
"nextTicketId": "adfdf17ec2f9e9a8"
},
"completionTime": "2021-03-25 14:41:40Z",
"serialNumber": 6243
},
"signature": "ufumu4kBvyHSw3fPy/tkBpS/SyF3M01DqCmkGZXtUjds99gm0fASSZOtd24V+YP9b+Q2ljG06luP0d4oG6P0dHq5mkJU99Cmu13smt90ryqzFbiDgwiVasl1G8xWrzHoYodv4Lt9HfEOGFIEIt3xBdukpC5bgYol1vcSgg4PQoNAa5Mal9ubOHrrLyrTuQPXI03FusW6kshKoTnhJtEWuUgdpZzdsNnjYthUryeus1SzNSOqegV8b9QhOyOzL+/4E7EsStARiv6Caoik+I978SlUtYIzRI0X2DqDDpczCXt0KBv5DpD+CiyeHP3rx9tsp1UL4++36UI6zr+DvQ5EPvnvDMUwMIKm+vLZDejOlrRNtcvWl9W79QxhMInJaSB+sB+pPtBrciF2Kanr6J9f9XPK3TTQz4Na6Xhl7yL0L2reHZsvvFIX9z2ZquNLTjco6kCkAmu0siWEuWvXlvR26IkVLg+nJ6K/QrygkKyC7I38YETr8acDJQ4yvA8BlqqMC7KoMQVAPnrDGVegGnNx6LDnCN8x9mQCV7T1kiPrJmC7K8Z7+rbWCrC8Dz1FWO1oyUO6M8NOGhNbKjYBK9pAb8d0ehc/RBb75pFhji7ePT1PL2acCbar2i/Z78+5OcDlm7bM6p0Ymf1gZRmNtqIFdZomvEvAYcIxYdS3kSrz2dg=",
"bitsUsed": 5,
"bitsLeft": 249495,
"requestsLeft": 994,
"advisoryDelay": 3240
},
"id": 26821
}
The method, n, min,
max, replacement, base and
userData properties are the same that appeared in the
request. The hashedApiKey allows the client to share
the full contents of the random and signature
objects with third parties without disclosing its apiKey.
The data array contains the single random number that
will represent the client's roulette spin. The license
shows that the values are licensed for development and testing only.
The completionTime specifies UTC time zone (‘Zulu
time’) by the letter ‘Z’ after the clock time. The
service advises that this is the 6243rd request to be completed with
this API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId is
null meaning that the ticket that was used for the request
is the first in a chain. The value of nextTicketId
contains a newly created ticket, which the client can use for their
next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits and
requests are left in the client's quota. The service advises the
client when it can issue the next request, after a short delay.
Like Example 3 above, The following requests a single value in
the [0,36] range, for example to decide a spin in European roulette.
The client specifies a value of false for the
replacement parameter, but this has no effect since
we're only generating a single number. The optional base
parameter is used to indicate that the client wishes the numbers
to be returned in decimal form.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. However, this time, we specify a ticket that was
created with showResult set to true.
This will allow the random values returned in response to the
request to also be displayed by getTicket later.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"userData": null,
"ticketId": "57bc9dead64863bf"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"data": [
10
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "57bc9dead64863bf",
"previousTicketId": null,
"nextTicketId": "7b106f57d9f60c8a"
},
"completionTime": "2021-03-25 14:45:13Z",
"serialNumber": 6244
},
"signature": "5K+t7YRREMhpwtcTEHuIfBjCGXLG0Ocrsko5koTnHgeZ9h95jm0DplGg/P+HVkuuJFlSfiNHanrUgJ/uhO7zLXyPvuD/iEqme61nR+fe79CMl4dyNSXswZk/ax6PkOgIMGTR/C9UQPou6VdH8OraP0BBAtpJtSikj6yhIuStnC/2oydzmYVO6n9+kF/M9Zg1ikcXxwCH0MP6e8MgX00mOL7fXvLKjh5ZkxDvWz8gH/Nl96aFhSIsLva2N8b8Mj04y6JTrUKVIGEHrc06BVw1jd5QOq8sHYS5xjGDGpwLRp91SEYXVmJo5qV8uYWN9cxTbtcSBi4JfIUffB5DFjrPs0XhhC0/RYH1U3YE2Y/Z9lzwnCq6kKKU0lQVWyFUeQlVeVVvgfnJZrNvPbubb7+ZNewxn6Wx2uAprI8GQJK/qJid0uzoBB/pncp/36Dn3n/MwokJfkLa5i2mz5opWyhf+GxGoGfibSPT4zBnnBGICOaJ/KJFXSX3Y1CHoNddZSpHLaQTK2WUknNGLEIRS6hvATF73tUtgnXZ2+4CvYuHk5vYjRHdl3BTWjNuL1GU2Bcl8NCi76rBUkSpfpnsJ+0y0a1jelXfMCREPbN8/UKUOHZTafiX3+iOqYB681DEUybfCFRn53h438Hp9vDwc1qqfg34CkUkZspw0z7CASSYMXM=",
"bitsUsed": 5,
"bitsLeft": 249490,
"requestsLeft": 993,
"advisoryDelay": 2720
},
"id": 26821
}
The response is very similar to that discussed under Example 3
above. However, we will see the difference under the documentation
for getTicket where we will retrieve the two tickets.
In this example, we will issue a request that uses the same ticket as was used in Example 3 above. This is to show that tickets can be used only once.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"userData": null,
"ticketId": "b09671d3a527cb5d"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 422,
"message": "The ticket you specified has already been used",
"data": null
},
"id": 26821
}
In this example, we will issue a request that uses a non-existent ticket.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegers",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"userData": null,
"ticketId": "7777777777777777"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 420,
"message": "The ticket you specified does not exist",
"data": null
},
"id": 26821
}
generateSignedIntegerSequences (method)
This method generates uniform or multiform sequences of true random
integers within user-defined ranges. Uniform sequences all have the
same general form (length, range, replacement and base) whereas
these characteristics can vary for multiform sequences. Your client
must set the method property of its JSON-RPC request
object to generateSignedIntegerSequences. The request
must also contain an id member, which will be returned
in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynlengthlength must be an integer in
the [1,
10000]
range. For multiform sequences, length can be an
array with n integers, each specifying the length of
the sequence identified by its index. In this case, each value in
length must be within the
[1,
10000]
range and the total sum of all the lengths must be in the
[1,
10000] range.
minmin must be an
integer in the [-1000000000,
1000000000] range. For
multiform sequences, min can be an array with
n integers, each specifying the lower boundary of the
sequence identified by its index. In this case, each value in
min must be within the
[-1000000000,
1000000000] range.
maxmax must be an
integer in the [-1000000000,
1000000000] range. For
multiform sequences, max can be an array with
n integers, each specifying the upper boundary of the
sequence identified by its index. In this case, each value in
max must be within the
[-1000000000,
1000000000] range.
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
replacement (default value true)replacement
must be a Boolean value where true indicates the
sequences will be picked with replacement and false
indicates that they will not. For multiform sequences,
replacement can be an array with n Boolean
values, each specifying whether the sequence identified by its index
will be created with (true) or without (false)
replacement.
base (default value 10)base
must be an integer with with one of the values 2,
8, 10 or 16. For multiform
sequences, base can be an array with n
integer values taken from the same set, each specifying the base
that will be used to display the sequence identified by its index.
Use of the base parameter affects the JSON types and
formatting of the resulting data as discussed in the documentation
for the generateSignedIntegers method.
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the numbers were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object to a third
party and allow that third party to associate the response
with a given apiKey, without requiring the client
to disclose the actual apiKey.
n, length, min, max,
replacement, base
params
object. Values that are optional and did not appear in the
request will appear in the response with the default values.
The reason these are included in the response is to allow them
to be signed by RANDOM.ORG.
datalicensedata can be used. The API key
owner selects a license for each API key created, which affects
this field in the responses generated for this API key. For
example, an API key could be licensed for non-profit use only,
or for commercial gambling up to a certain prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response with
the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the
corresponding hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature properties,
such that they can be shared publically or with auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests six numbers, five from the [1,69] range
and one from [1,26]. While the two sequences are multiform (they
have different lengths and ranges), the request only uses the
array format for the parameters where the values are different.
The replacement parameter is set to the simple Boolean
value false (rather than an array of Boolean values),
which means both sequences be picked without replacement, i.e.,
will not contain duplicate values. This makes them suitable for
use as winning lottery numbers, for example for a US Powerball
type lottery.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegerSequences",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2,
"length": [ 5, 1 ],
"min": 1,
"max": [ 69, 26 ],
"replacement": false,
"base": 10,
"userData": null,
"ticketId": null
},
"id": 15443
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegerSequences",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 2,
"length": [ 5, 1 ],
"min": 1,
"max": [ 69, 26 ],
"replacement": false,
"base": 10,
"data": [
[ 69, 49, 39, 43, 20 ],
[ 10 ]
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-18 14:02:47Z",
"serialNumber": 6200
},
"signature": "ZFf+zE3iG3C8ndAp9BiH8vLKdXHsKwWMLanGOgxLRHYIjKNWNeqIqo1577Lz+7w2gvRxNXy+IvLf0hdoTpZ1wa8DZGUShrXqy7OQ01lHFyoay5zveJP87L/ZJKgdAF+iXTtRuF2nFoMXFW/GDsuuAbpE3f4McBiSGPMwp8jaV3ibmId4vWpSWqik/h9pHJiU8YullBKJ4/LQu8IfywMULANZmgFMTgp50u4DgWPNxgHCvpBWGPDH0wFxjgliI7G6eBFfNGXYV/xoGxalMfhMo1ivkzEIZHdJFHSsXbEHsKO+sH9ZpaiGoWJmGJV2EOdieSLDm6MOVLYVRapXyhn2/bm4ub0VxHrO3EAiVWKK61QivWY9N+GdTqf3RsqKjaVpCncUu1SuypR+4tviyZJYkaVfVOWp00/lhz1+zyGRAlZANcCQEOLLCcS2zkVXhFCIZUq/S0c47gyk+6EqrL5RUtFFMWaNgbWyJMzyjOW+GR3RsonFUrRpUk3SnEGQnkMnjJT7tUbhrFA0yoUlL7UrXVh29gaxoLyHBxsKIovz414I+MCpONf4f79pfKT2nQk6efQk2NwynVp7OUNxLZPLRAlUsUVbUAI+XoxZjlpXpxaU8gBr/sO3Zf6AdrEZK4wGIlSd0jzwtYa3UOcF4AO+G9nneJzE0Jo6T1kS5qJgFRc=",
"bitsUsed": 36,
"bitsLeft": 248369,
"requestsLeft": 995,
"advisoryDelay": 2790
},
"id": 15443
}
The method, n, length,
min, max, replacement,
base and userData parameters are the
same that appeared in the request. The ticketData
property contains its default value of null, as
the request's ticketId parameter was also set to
null. The hashedApiKey allows the
client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The random
object contains the true random numbers (in the data
array) produced. The service advises exactly when the request
was completed, and that the values are licensed for development
and testing only. The serial number indicates that this is the
6200th request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits and
requests are left in the client's quota. The service advises the
client when it can issue the next request, after a short delay.
This example is similar to Example 1, but this time we're specifying
a value in the userData string.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegerSequences",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2,
"length": [ 5, 1 ],
"min": 1,
"max": [ 69, 26 ],
"replacement": false,
"base": 10,
"userData": "Winning numbers for Week 41.",
"ticketId": null
},
"id": 15443
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegerSequences",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 2,
"length": [ 5, 1 ],
"min": 1,
"max": [ 69, 26 ],
"replacement": false,
"base": 10,
"data": [
[ 44, 42, 68, 8, 60 ],
[ 6 ]
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": "Winning numbers for Week 41.",
"ticketData": null,
"completionTime": "2021-03-18 14:12:30Z",
"serialNumber": 6201
},
"signature": "h0PxHkqK7eKUon5mHlV4kzd1ovwcqJDrVk7eOHZ8NAQX3eyXsL2HnYQFuB4YuZ9/nhTEea5TvKZl8AiTZ78nmuN956BczZU5zLy2HnzH3UxV62yIEAX9QpYHuOAf/kmZ38NVBP2xSGocy88ViDgA0hWTbuubpz4QS5u24FRt+YA5f89HjOoiSXvIw0LNrN29MNzK1JiNskpnbGdbi0BPCHXppCg+3ky0ubs33jOB1pnHjGJOz8ncp+i5Q1uJrpbxttSJvjZxAw8NCa2nJx2U52yP1UzzIcsCvpQmZztlxHma+rdk9HFP8pYD6NIu7IaMbQqqalBqxF8r1W9Xunmv/AG36c4g8XDOdmwkDBUDN69Z2P5Ye3yrgwENhMzxZQZdFo0fKYvG74Lu8nLzMnfiu/Wa2eqWb9IhdPM6vZN+FxKjOHPdGazuyPXL2Ev9vCbU8vt+Dy0L6leBdty3Nl601JndR/F9XqcZjo4MDKfD660c2wnyRDxd7pkv3SVojKmzdHSLf9HaIl2sCmrqXw3K+DW/hJyKH6eg2dNoOggj35DRMBexVjCWA8DTpcwKw5OqDUMN6cR1D1nRs1AO/0LxSVM0QxHRVgiNi+MjZspHbAgjxEZQcoIhyB3oKeG8z9Nb+ApAPLoxja6FLH8c1Z+gaS+vMyYO4ZtWBZCrXnGNikk=",
"bitsUsed": 36,
"bitsLeft": 248333,
"requestsLeft": 994,
"advisoryDelay": 3190
},
"id": 15443
}
The result is very similar to that in Example 1, except that
the userData property contains a non-null value, as
defined in the request's userData parameter.
The following requests one random number from the [1,8] range and
three from the [1,6]. Both sequences are generated with replacement.
The numbers could be used as a 1d8+3d6 dice roll. In some fields
(min and replacement), the caller gives
an array of identical values and in another (base) a
single value that will apply for all sequences. The two approaches
are equivalent, and both are allowed by the API.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegerSequences",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2,
"length": [ 1, 3 ],
"min": [ 1, 1 ],
"max": [ 8, 6 ],
"replacement": [ true, true ],
"base": 10,
"userData": null
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegerSequences",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 2,
"length": [ 1, 3 ],
"min": [ 1, 1 ],
"max": [ 8, 6 ],
"replacement": [ true, true ],
"base": 10,
"data": [
[ 5 ],
[ 1, 4, 1 ]
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 15:01:06Z",
"serialNumber": 6245
},
"signature": "UGvEpnKqByHm7iyyEM/e6T3PMKaxwfxO7HznsZJoKjLWm3EyaUzQCfH0HiU2492DVhrm9rT+Ev0UnMRaGZCBePmJuY1dcqjUWcJguP/F1RFm10H/kKS26+zHmOuqL6nfkfib5x1RsMKvr7qRhy9cJALtnPAtPeMHWOcDF4ww0bIdWc6g02/lgD1bYD+Y1srVO/iCyBrGDcqx04qY5yYZbQd7ka6BE8oYfEJBJ5hNJYxGAaobISt74p0aAMQpaVZ5YNmfO8stWshke4GBL3/K4hZpgsqIlMhJkolR8MKQVZAXwe0aLpRZ6BGdkHfT7Ixbyk0TnR6Yf2o7kUKrpSsT2UpDf96B3M1MuZtKg6YoPM/D/0mONVc1WOMIb15pZOkZpZuB4e2wqOwfwpWyZL1QvaTkKz1m1vUkCxOPS0YBHo0cjxyjnavF3OZBFUYMUfc4EfGa8R2gyyOxYwb3COvSgG7/ZxvdUxif9P98vNhK/Aje1yLVe4QW0wKRmC7ZLnOlJiT5OASrhJ5YYO5PX4egPjBMfQQUDUP73ztlv3RtpKPKV4lzqTICb6pLpS+DSl7/smrROGVIljOQmufDIdgf1ogG7oQ9YCP3FYBWZFNlJAWhtPIU+Q7ooXtA+7gwiksLlpWODXRLkr/x9gLHRAawJKID1FUluHwONebityNkGHw=",
"bitsUsed": 11,
"bitsLeft": 249479,
"requestsLeft": 992,
"advisoryDelay": 2750
},
"id": 26821
}
The method, n, length,
min, max, replacement,
base and userData parameters are the
same that appeared in the request. The hashedApiKey
allows the client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The random object
contains the true random numbers (in the data array)
produced. The service advises exactly when the request was completed,
and that the values are licensed for development and testing purposes.
The ticketData object is null, as the
ticketId parameter did not appear in the request. The
serial number indicates that this is the 6245th request to be completed
with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
when the client can issue the next request, after a short delay.
The following requests three uniform randomizations of the [1,52]
range. The replacement parameter is set to
false, meaning the numbers will be picked without
replacement, i.e., duplicates will not occur. This makes them
suitable to shuffle decks of cards.
We're also specifying a ticketId, which is the
ticket identifier returned by our Example 3 under the
generateSignedIntegers method. This ticket is the
second in its chain.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegerSequences",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 3,
"length": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"userData": null,
"ticketId": "adfdf17ec2f9e9a8"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegerSequences",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"length": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"data": [
[ 35, 8, 44, 1, 26, 21, 3, 46, 12, 18, 19, 41, 7, 2, 29, 34, 22, 25, 28, 27, 39, 51, 42, 13, 24, 20, 23, 47, 11, 37, 50, 6, 17, 15, 4, 49, 9, 38, 14, 16, 40, 5, 36, 45, 30, 48, 52, 43, 10, 32, 31, 33 ],
[ 21, 16, 45, 31, 25, 5, 34, 37, 9, 28, 29, 8, 32, 46, 18, 35, 47, 17, 1, 6, 50, 43, 10, 24, 42, 48, 33, 14, 39, 20, 22, 51, 15, 36, 2, 7, 12, 13, 49, 30, 11, 4, 44, 3, 41, 23, 27, 52, 38, 19, 26, 40 ],
[ 4, 13, 44, 17, 47, 10, 41, 3, 7, 6, 18, 37, 26, 52, 9, 35, 21, 1, 14, 24, 30, 28, 12, 23, 43, 8, 31, 20, 39, 48, 29, 46, 22, 51, 25, 42, 5, 38, 33, 16, 34, 19, 11, 45, 32, 2, 15, 27, 50, 40, 49, 36 ]
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "adfdf17ec2f9e9a8",
"previousTicketId": "b09671d3a527cb5d",
"nextTicketId": "d8000eb301b48279"
},
"completionTime": "2021-03-25 15:06:34Z",
"serialNumber": 6246
},
"signature": "cnj+6qdHWWCl0Hrns/y9aXwEwq2t0A9vqHiFySf836wAnYn3mCvmLwlMmMhBSXaXH5ylkqVqh53zuhb7hq6ayLvnLNXXP6FuPmm1R3IN0+JKAIKgNHwvU4Wmn+1TAvQt7rgQbINXsZhWUYlqEzySbsMtjE2uFPoeOOcLYT0ZubuHRzFwVF/p1KEinrzG9WMF9kJXezUZrFxIdu1ZSf7dVgDiVQB0yO2SdnYPh6H2cNVcb0pEC+mwiXX5Qzh0mwwSmIAxOB8rzasEvrypB8e8fPgwRnEPUJmhZGa+buVD4KjQ/iDjKNxYyzZ1coHS9tTBAS1LySLbNs7UPgkUfkx1tSIsw0SFGZe9mIzzNU/U/HTn8YnNQjTslOGtz9XMf+wvfekKx2rtUBS3TLGWGKakdx+oPi5n1ABAjXwDOnNhOpZ4G4OKN1Skji8CiS1WKmanPXwesaFaX9NrycewQJTrxsyzpfM7prf+pwpsn+DvwOt48r8SRcLEzH06coiYDRYAOre6FvOM6DTwfzCaJSqhO7UxtMACtl845z8sIo+F4udRsgd7/JsICI/Sg1hBGyAHMEZSrfCxxJ1f5flh0HDDNCqj9kB1vjaNeHVChk7dr7qw/Qntbjf6J4jNPBbXdoprFO+w+/rewjh1YxrK2eRhTnzhERfRfnJZxLQHxvXw23Y=",
"bitsUsed": 888,
"bitsLeft": 248591,
"requestsLeft": 991,
"advisoryDelay": 2330
},
"id": 26821
}
The method, n, length,
min, max, replacement,
base and userData properties are the
same that appeared in the request. The hashedApiKey
allows the client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The random object
contains the true random numbers (in the data array)
produced. The license shows that the values are licensed
for development and testing only. The completionTime
specifies UTC time zone (‘Zulu time’) by the letter
‘Z’ after the clock time. The service advises that this
is the 6246th request to be completed with this API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId contains
the ticket which was used in Example 3 of the
generateSignedIntegers method. The value of
nextTicketId contains a newly created ticket, which the
client can use for their next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits and
requests are left in the client's quota. The service advises the
client when it can issue the next request, after a short delay.
This example is very similar to Example 4 above, but this time,
we specify a ticket that was created with showResult
set to true. This will allow the random values returned
in response to the request also be displayed by getTicket
later. The ticket was returned in Example 4 in the description of
the generateSignedIntegers method.
{
"jsonrpc": "2.0",
"method": "generateSignedIntegerSequences",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 3,
"length": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"userData": null,
"ticketId": "7b106f57d9f60c8a"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegerSequences",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"length": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"data": [
[ 6, 10, 40, 38, 5, 43, 4, 24, 18, 8, 29, 33, 42, 22, 32, 51, 7, 35, 44, 26, 1, 31, 15, 9, 3, 12, 39, 48, 14, 2, 46, 25, 13, 30, 21, 50, 52, 34, 45, 16, 20, 27, 28, 47, 37, 49, 36, 23, 11, 17, 41, 19 ],
[ 44, 3, 32, 39, 5, 45, 1, 16, 9, 17, 25, 41, 22, 37, 51, 35, 50, 29, 26, 31, 28, 7, 2, 27, 40, 24, 19, 20, 43, 18, 6, 52, 4, 8, 49, 33, 36, 10, 48, 38, 23, 14, 11, 13, 34, 30, 47, 12, 42, 46, 15, 21 ],
[ 25, 46, 13, 15, 4,35, 6, 45, 8, 41, 7, 37, 3, 18, 30, 42, 43, 38, 10, 52, 32, 39, 5, 14, 40, 27, 48, 23, 19, 12, 49, 31, 47, 44, 28, 9, 51, 2, 16, 33, 24, 17, 22, 20, 21, 11, 34, 1, 26, 36, 29, 50 ]
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "7b106f57d9f60c8a",
"previousTicketId": "57bc9dead64863bf",
"nextTicketId": "dc4f0095a24633f1"
},
"completionTime": "2021-03-25 15:14:42Z",
"serialNumber": 6247
},
"signature": "W5tWPvjRjZ2miXIscyngOdNVyIeVI98flMXM5+hKO6MLiFQD9ECtDpphsWzFzKK9F39zmFIgZQt6LlDZAWGRJQX2Be76/w//UaVObuJLnvp3YTMy1JXt2kPJ6NcfnayJ9rM46WYyTwuNJ2/dZIsvi1V+1Qgm6zXwrN3j4h1snwVNlHOiewU/4yOwxrfcsiFZUJdG92OyXjIR0lQRRRk8IoNEwq7Cn0Sqp+CYGgbOhFJbY7q2Qh3ypJhY4BZwCDHvLvbNgCLkfiBp+xEEq5RR+oBD5obsfUfTaPJVCjPbCtsPOiq7apede/tD9EhOnef6Tpg5r40/M/b8W4iIj0QGyHTFscYuE5wJk8vMzpsTUHa0kpqhJUYLr0so2XCyZsxGGF/6AsZHlkf14k++j/Z8CZjKxltJ6nICFIXaMDCPKn6oHQjNjs8BemoKTQi0jTBQCgJZ9RNP76dICYfRCsPxo4Ea9cJyUDhI0hoO3D5aQy0zTcU4A/Ekj3eMjHN4jnMloPAd7czqZNWwwUnvEeTW4iiiZ74r4eg3bDGzH44zuQyKTy1IgbEoYe9h0AKjfWR4HgKz6XVX5n3eNYNcMg0SKZcco/QXWrNgbDbRs9W/PhrvupUiADJLUqCOiQOC2TJPeZjPs+mJUsrDwd6Olrq+KcPCEn0vzUTGho5LfcuT9mQ=",
"bitsUsed": 888,
"bitsLeft": 247703,
"requestsLeft": 990,
"advisoryDelay": 2560
},
"id": 26821
}
The response is very similar to that discussed under Example 4
above. The difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
generateSignedDecimalFractions (method)
This method generates true random
decimal fractions from a uniform distribution across the [0,1)
interval with a user-defined number of
decimal
places. Your client must set the method property of
its JSON-RPC request object to generateSignedDecimalFractions.
The request must also contain an id member, which will
be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeyndecimalPlaces
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
replacement (default value true)true) will cause the
numbers to be picked with replacement, i.e., the resulting
numbers may contain duplicate values (like a series of dice
rolls). If you want the numbers picked to be unique (like
raffle tickets drawn from a container), set this value to
false.
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the numbers were generated successfully,
RANDOM.ORG returns a JSON-RPC response with the
result property containing an object with the following
named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
n, decimalPlaces, replacementparams
object. Values that are optional and did not appear in the
request will appear in the response with the default values.
The reason these are included in the response is to allow them
to be signed by RANDOM.ORG.
datalicensedata can be used.
The API key owner selects a license for each API key created,
which affects this field in the responses generated for this
API key. For example, an API key could be licensed for
non-profit use only, or for commercial gambling up to a certain
prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response
with the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the corresponding
hashedApiKey).
signaturerandom
object, signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature
properties, such that they can be shared publically or with
auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests ten random decimal fractions with eight
decimal places. The replacement parameter is set to
false, which means the numbers will be picked without
replacement, i.e., will not contain duplicate values.
{
"jsonrpc": "2.0",
"method": "generateSignedDecimalFractions",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 10,
"decimalPlaces": 8,
"replacement": false
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedDecimalFractions",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 10,
"decimalPlaces": 8,
"replacement": false,
"data": [
0.86857886,
0.79228694,
0.67173086,
0.07518909,
0.71114196,
0.00490702,
0.58364572,
0.67150322,
0.94096249,
0.95416701
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 16:23:37Z",
"serialNumber": 6248
},
"signature": "Sl5iXAE8WorU8ETrmbc3AEG6GhSeGOGu6qw/DRqYxcE3SIMu/dgbp3p8uGOz2npEi/S0FYed7Ub9g+IkkOZe0/Vx1In/Ajh537GZXaORcYIuHna05iiXVCiMgZcctIsiw94sqwlrnuqHaMcZ+YUujF8JUiuwflohASyMd5N0r7U4hpv/HIuGlPByMDrhkFt/pP4HIpGZ/LOdGhak3G3BiNJ6fotwEfxwgddGclm9+30oCLd+mv4afvKQr2KtU4i4qjLfCsIF5bFh11KSznZDfWHHlxywRUUjcpRZXmdOKG09rYz+JgT5I5H0n2MkcB7ikmJ47Vkx8aXCedqTAKNP56i1LFFtquAWlyL57woS4R1O6duinYv8B/Zu+wg9xKlTw0e5Sm8DwjQWXzw3tH39dzv95n/1lP6wpt+I5IBbr1TyUNYuDylTKbNLvZIEYADF5A5qUyUlDaEvs7ygVO+Tk8W+UBmBg3S6H7onLxF9MB/mZq3j/aCNidqUy/J8O0oHGldi5JWxvUeW3pSj9lGhsBz0K2L4nj+RWefhrZIZw4PO0Z4RoEp96FUhpMQ2SbLO+mIDqgH9LbVTs3b2XrSS/yao+SN0M0Jb/OImRsMotbivA3+tH9rJGXWfF/XJChE0J+rX1Z6c6vd93Ss0iZvmerjkZNv0mL0Lm5Dblj4UPZM=",
"bitsUsed": 266,
"bitsLeft": 247437,
"requestsLeft": 989,
"advisoryDelay": 3210
},
"id": 26821
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random values. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without disclosing
its apiKey. The n, decimalPlaces
and replacement parameters from the request are included
too. The userData properties has been added with its
default value, even though it did not appear in the request. Similarly,
ticketData has been added with the value of null
because ticketId was not included in the request and
therefore defaulted to null. The data array
within the result contains the true random values produced.
While eight decimal places are used, final zeroes are not shown, making
some values appear to have fewer decimal places. The license
shows that the values are licensed for testing and development only.
The completionTime specifies UTC time zone (‘Zulu
time’) by the letter ‘Z’ after the clock time. The
value of the serialNumber field indicates this was the
6248th request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random bits
were used to satisfy the request as well as how many bits and requests
are left in the client's quota. The service advises the client when it
can issue the next request, after a short delay.
The following requests 20 decimal fractions with 14 decimal places
picked with replacement, meaning that duplicates are allowed. The
caller uses the userData parameter to add a comment
about what the purpose of the numbers is.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. The showResult property of the ticket
was set to false.
{
"jsonrpc": "2.0",
"method": "generateSignedDecimalFractions",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 20,
"decimalPlaces": 14,
"replacement": true,
"userData": "Values for Simulation #42",
"ticketId": "d8000eb301b48279"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedDecimalFractions",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 20,
"decimalPlaces": 14,
"replacement": true,
"data": [
0.27452061282332,
0.55725714644033,
0.70615799786564,
0.59224309732265,
0.99037216890053,
0.67156108520312,
0.30375116873441,
0.65901413611548,
0.59382223046623,
0.81054521575213,
0.05337776711386,
0.81875993164798,
0.20826402383088,
0.15604901301649,
0.38008543002819,
0.68029728502851,
0.21371910797906,
0.36733436902759,
0.42318378251419,
0.62531147412791
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": "Values for Simulation #42",
"ticketData": {
"ticketId": "d8000eb301b48279",
"previousTicketId": "adfdf17ec2f9e9a8",
"nextTicketId": "97ed218c4032d237"
},
"completionTime": "2021-03-25 16:27:40Z",
"serialNumber": 6249
},
"signature": "lbH+9ETBA7V9ts0FoXJm0iyVyAsYg1UV+UlzMzcMjwilyGAYH0rkJpWEo0yII1iKc1XyDcAggur2ZeKrItiLRfh6lc4n9SkFnVvpPQn/1H41gezZXS85l6gQ5otr8zlAHhOSUo66JPWcprAAcngngAL/neWS5+M/EFl24aAM70riuZ4nOo4eMWIy3BVfQpYrSbMlswAq4vHSJhI5EAFjRty0eZ7oXr6clCpgaovb8aedlsUPQGH0TGN2Sxs08deSJ3LFChcwYdG45qaPHXYOHdQdkuvVtk+fIrqpu1GxvtMDzf6ycHn2e0aJ2E8JuCptfhP8ODwwgAH0D/RHxbMJTEdw7MoTwdnmQFh8qkq1XYyu1gp34biNQh5FEZS71m1ek8K7IeNBJr6WgGgVkdZTfo839z9NO9Hv+17fppUaEtOSf3oZkwXOlsMW3ynI57iQ6sjGYd8crXcLjALyFfXLhQljhqWUl/aV4k/FhntlU8eDzJvx1NAz81tKrwMWUgfNX5y8vzmitMIXoQBzhOGIpWSDXON8q2hJcltjPxe+FZqkVJZnaUTCnH/I9mrlSNdrIBkinxqmrp63PK5sCyZGPPPEMxVlZ4xOwtIMeacIIe9/3VaPEk8OSuWEd5adCEppVyG3siVr5sh3RVuixsoC6oFVQd4gGcJ41c5+IFTVCzU=",
"bitsUsed": 930,
"bitsLeft": 246507,
"requestsLeft": 988,
"advisoryDelay": 2870
},
"id": 26821
}
The method, n decimalPlaces,
replacement and userData properties are
the same that appeared in the request. The hashedApiKey
allows the client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The random object
contains the true random numbers (in the data array)
produced. The license shows that the values are licensed
for testing and development only. The completion time is also included.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId contains
the ticket which was used in Example 4 of the
generateSignedIntegerSequences method. The value of
nextTicketId contains a newly created ticket, which
the client can use for their next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests four decimal fractions with two decimal
places. The replacement parameter is set to
false, meaning the numbers will be picked without
replacement, i.e., duplicates will not occur. The client also
specifies how it intends to use the values by passing a string
in the userData parameter.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. In this example, we specify a ticket that was created
with showResult set to true. This will
allow the random values returned in response to the request to also
be displayed by getTicket later.
{
"jsonrpc": "2.0",
"method": "generateSignedDecimalFractions",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"decimalPlaces": 2,
"replacement": false,
"userData": "Sample values for Experiment X.",
"ticketId": "dc4f0095a24633f1"
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedDecimalFractions",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"decimalPlaces": 2,
"replacement": false,
"data": [
0.11,
0.77,
0.54,
0.62
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": "Sample values for Experiment X.",
"ticketData": {
"ticketId": "dc4f0095a24633f1",
"previousTicketId": "7b106f57d9f60c8a",
"nextTicketId": "9770198892bf61c7"
},
"completionTime": "2021-03-25 16:30:15Z",
"serialNumber": 6250
},
"signature": "6V16xK4jTVByKwS9FvHlpOpvmFUH8aPjqUNkCsEC8Qq30oRCFZMxtkJgnG0WJZVRvUWPyMIjiybaZOFUFIT9s85fetXtukfBRjG+UE7PzL0fC+U21hK8yzhogpvIK2szQGLvZSIIoS46kV6n47RhtfTVoFtuoY4eRK8hcuNAIgeAaBKEHmx6EqEMqfgDJkDihmIqLEksm3Vf9cdvJkyxV4EsnacXJC2nGwQE+G7TcWgAlNv1Z2ZJPYnktMfV6WddkgbKKVrXzMHaeQ7siXZtW35CZkVKV+AuG4xJiohhAnpqCUqpC4/0YeEJVDdtDjLYfuZw70R++Y4/FiLrcj81uSJ0UaS1d1kZ39zUydqtC/RvkCwh5pXu+3ugaNKxKwctMdDZsP0lVeGA7M0+MLJn6JxFdy25i7VC1S0bCICb2+sobxQOnpC9sqLKNceavoWuqSN7eRRSMF7BAEQOoz3eZFMlwZyblHOBnN5ZNqfhQCYxa4VU5Bn65fk2enK1xJo0WxVfjJBNPWI0I94xxkrvVTVz7N1B4d5CJpXTeQVUmY0OvyUTxXUcRJCIjcLsmwxaXj/NLBk94gQ2VY1qN+xQwotPP7c46eZUl8DMzK/I7sfrF1MDAgoE/ygB5woFupZJm5h04FNUj2xt7gKCL1pZplP7umOnQ5lS9rH7fi1gkdE=",
"bitsUsed": 27,
"bitsLeft": 246480,
"requestsLeft": 987,
"advisoryDelay": 2620
},
"id": 26821
}
The response is very similar to that discussed under Example 2
above. The difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
generateSignedGaussians (method)
This method generates true random numbers from a
Gaussian distribution (also known as a normal distribution).
The method uses a
Box-Muller Transform to generate the Gaussian distribution from
uniformly distributed numbers. Your client must set the
method property of its JSON-RPC request object to
generateSignedGaussians. The request must also contain
an id member, which will be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynmeanstandardDeviationsignificantDigits
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the numbers were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom contains the following
properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
n, mean, standardDeviation,
significantDigits
params
object. The reason these are included in the response is to
allow them to be signed by RANDOM.ORG.
datalicensedata can be used.
The API key owner selects a license for each API key
created, which affects this field in the responses
generated for this API key. For example, an API key
could be licensed for non-profit use only, or for
commercial gambling up to a certain prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response
with the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the
corresponding hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature properties,
such that they can be shared publically or with auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests four random numbers from a Gaussian distribution with mean 0.0 and standard deviation 1.0, accurate up to eight significant digits.
{
"jsonrpc": "2.0",
"method": "generateSignedGaussians",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 8,
"userData": null
},
"id": 26821
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedGaussians",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 8,
"data": [
-1.318028,
0.46226845,
1.063625,
0.35347613
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 16:33:34Z",
"serialNumber": 6251
},
"signature": "j7borqeVO9IYuHGs2v/npugKoAZvPhYlK5hyUrz+Ut6JrgBT96dWj4EEBouPC7j/QyBTldir6q30VXpPZNfqPfJQe+Cztjzy3Tauo+AB1coVatPSibc3C3ngOeSfFFOerLYYBAd1d5YO0PbDcRU+3jBS62dgnOtLFnQAGzbtaiApeIs36kl6XkaLues4Z+HQySoLYuykIAxrNeqPVBBPSx6lRvtmf4zCPJ8GvsEpYnbZCE/0gIiIJGRsvtD1c8BNcGePZNYpmFTxF/YkvFI/yEfDXrrSUT4gN0EohOZdgnK0tG7a47MKWTkyNdexvt8lEvaUWQZNEFijetYw2IqtXet/g1RTxOE2Ge887ZIDPra30UXCxFoh1Its6VCSVQ6Hpkw8zxKwx5dawy1BEahk8nswMHszVfcYtEPPGFN4113i2pMqoC8O+7nSlyZCH3xl+E2VA8iL3OfRkn6JtgC12S3huL4yJKpJRUeNr1WCc606rYyZFChVHGhM1Qx/oPCP6w63tG36pjTH/fPLD9uBKrr9TvdkT5a+uJGyhsUw4vnh4VheL4SvYmb20Q6VdJJM0b6T4D0oNoImEVk5OcodAy8KvvpYAFiuq1tTWqHFg3/OG0zRlcGhVTPDmIQ/nPvVa4eLJve/rNyOFPw2zjAhN9OMK9uVrgoISYTHfdpBvFQ=",
"bitsUsed": 106,
"bitsLeft": 246374,
"requestsLeft": 986,
"advisoryDelay": 2690
},
"id": 26821
}
The method, n, mean,
standardDeviation, significantDigits and
userData parameters are the same that appeared in the
request. The hashedApiKey allows the client to share
the full contents of the random and signature
objects with third parties without disclosing its apiKey.
The data array within the result contains
the true random numbers produced. The license shows that
the values are licensed for testing and development only. The
ticketData property is null, as the
ticketId parameter was not used in the request. The
completionTime specifies UTC time zone (‘Zulu
time’) by the letter ‘Z’ after the clock time.
The value of the serialNumber field indicates that this
was the 6251st request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client that it can issue the next request without delay.
The following requests 2,000 random numbers from a Gaussian
distribution with mean of 1,100 and standard deviation of 100,
accurate up to four significant digits. This could be used to
simulate the lifetimes of lightbulbs (measured in hours), as in
example 10.3.5 of
Handbook of Statistical Distributions with Applications.
The example includes this as a note in the userData
property.
{
"jsonrpc": "2.0",
"method": "generateSignedGaussians",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2000,
"mean": 1100,
"standardDeviation": 100,
"significantDigits": 4,
"userData": {
"simulation": "Lightbulb Lifetimes",
"dataSetNumber": 42
}
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method":"generateSignedGaussians",
"hashedApiKey":"ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 2000,
"mean": 1100,
"standardDeviation": 100,
"significantDigits": 4,
"data": [
975.9,1143,1198,1171,972.9,1011,1190,1039,994.8,1209,1038,1261,983.8,1025,1200,883,1163,1006,1150,1174,1125,967.6,1182,1119,970.8,964.5,1202,1016,1129,1004,996.5,1158,1031,1033,1114,1007,1213,1060,1308,1073,1064,1150,964,1123,983.1,985.9,1087,1009,1087,1131,1065,1075,1134,925.9,1210,1144,1218,1257,1031,1135,1072,1111,1150,1101,1086,1054,1271,1037,1238,1141,946,1043,1102,1165,1017,1271,960.5,1284,936.2,1030,951.9,1112,984.3,1074,1280,1130,1079,966,1081,1008,1209,952.5,1137,1060,1128,1216,1034,1108,1059,1339,954.3,917.6,1094,922,1030,975.8,1223,931.8,915.2,1179,975.4,1090,1115,1217,1149,1169,1198,1071,1154,1216,947.1,1149,1044,978.6,1128,1163,899.6,991.4,1280,1291,1192,996.9,1153,1167,1169,1185,1131,1171,1046,1006,982.3,1171,1067,1123,1121,1121,1317,1212,1102,946.2,1171,994.9,988.6,964.5,1204,1175,1177,1060,1098,1107,1296,928.1,1036,1010,1134,1041,1136,1200,965.1,1045,1057,1157,1063,1197,1061,1274,1133,1070,1170,1185,1068,795.8,1107,1159,948.7,1160,1176,1127,1221,1101,1050,1128,938.8,1192,887.7,975.4,1061,1178,1158,809.4,1092,972,1348,1053,1145,1144,1009,1121,1066,1137,1127,1054,1163,895.9,996.6,1117,1132,1106,1030,1130,985.4,1091,1456,952.6,1030,1131,1172,1132,1119,1124,1196,1164,1093,995.9,1274,1223,1091,1242,1148,1164,819.1,1127,1037,1227,1029,1206,1094,1084,1047,1068,1227,1009,1031,952.8,1085,1165,1004,1135,1104,1344,957.3,1050,1081,1025,987.6,1123,951.2,1136,1219,1189,1137,1179,1079,1126,1141,1105,1223,1058,1138,1041,988.7,1067,1212,1081,1150,1142,1093,1298,1225,1089,774.7,1131,1137,1026,1136,885.5,1001,950.2,1061,1082,1197,1156,1113,1250,884.1,1071,986.8,1053,921,1056,1123,1057,1163,1157,1082,1110,1098,1136,1199,1235,1159,1037,1183,956.1,1216,990.4,1179,1241,1226,1131,1125,1096,974.1,1068,936.8,1104,1075,1043,1079,1105,1189,1103,1091,1059,1083,1060,1099,1045,1084,1108,1003,1210,1153,1179,1014,1123,1219,1011,937.2,1129,964,1060,1135,1169,1339,1138,1044,1124,1156,1126,1110,1116,1050,1033,895.2,1146,1131,1092,1165,1036,1209,1152,1190,941.7,1304,1003,995.9,1176,1092,1065,993.7,1019,1107,1014,1168,1116,1087,1230,1156,1134,1243,1028,980.7,1243,1207,1039,1134,1076,1132,1204,1071,1149,794,1089,960.4,895,1102,1168,979,1153,1057,1101,989.7,1241,1027,1144,1121,954.5,1113,1153,1017,1264,1232,1257,978.4,1088,1170,1133,1119,1048,1272,1067,1014,1242,1185,1241,921.7,1237,1039,1037,919.5,1178,957.5,1224,1075,1015,1191,1164,1251,1221,1035,1088,1144,1113,1185,960.8,1109,1107,1101,987.6,1020,1081,1177,1085,1227,1106,1071,1096,1235,1010,1047,1143,1029,1085,1178,1073,1008,1087,1116,1060,979.8,1077,1135,1071,1122,1051,1299,1143,1089,955.3,1156,1073,1089,1026,1034,1122,1159,1263,1043,1075,1188,1037,1110,1110,1294,1058,1052,1020,1004,1040,1095,1071,1056,1080,1128,1186,946.3,1052,999.2,1079,1052,949.6,1061,1150,925.8,1104,1242,1247,1057,988.4,1043,1161,1165,1133,1063,1039,1233,1031,1041,1081,1050,1064,1133,996.4,949,1026,1165,1111,1120,991.7,1142,1181,1133,986.2,1261,1012,1013,1125,1148,1019,1181,1235,1149,1165,1070,1109,978.9,1080,1287,1194,1178,1011,1158,1021,999.8,1000,1268,1110,1139,890,1030,1033,1246,1178,1057,1210,1220,868.7,1085,1174,1288,1210,1015,1091,1169,1032,974.3,1120,988.8,891.7,823,1107,1127,1058,1148,1461,1282,942.8,985.9,1284,991.7,1125,1263,1129,1037,1107,1112,1105,1168,1072,1128,1253,1148,982.8,1217,987.5,1037,1142,1170,1013,1005,1072,1154,1159,1178,1018,980.7,1130,965.9,1099,951.1,1136,1046,1104,1092,1181,991.3,962.7,1132,1025,1097,1097,1088,960.1,1133,992.1,1048,1137,1099,1162,1071,1031,1002,882.9,1115,982.8,1019,896.5,1058,960.3,1027,935.6,1170,1107,1144,1158,1216,1145,975.9,1058,1248,1001,1074,1308,1022,1288,913,1279,1046,1185,1130,974.7,988.4,1082,1219,964.4,1210,1035,1069,1173,1331,1074,1024,1061,1191,1168,1183,1217,1031,1397,1059,939,1091,1180,949.2,1017,1084,1057,1046,1205,1245,1004,1116,1166,963,1015,1323,1101,849.5,1113,1072,1196,1193,1036,1082,1286,1176,1256,1142,1036,1090,1299,1052,1183,1048,999.7,1049,959.1,947.5,1081,908,1147,1148,1059,1262,981.2,973.6,1074,1279,1128,1134,1113,937.7,1059,1118,1221,1203,1136,1049,1072,1098,1245,1089,988.6,1130,1136,1177,1123,1192,1223,1187,1080,887.6,1203,1175,1063,1278,949.6,1160,1268,1147,1002,1032,954.3,1143,1021,1167,1178,1014,1053,1054,963.9,982.9,1187,873.6,891.1,1326,998.1,1135,1078,964.4,1334,1274,1090,920.5,1208,1167,1087,1069,1154,1045,1177,1141,1200,1144,949.8,979.3,1215,879.4,1015,1036,892.6,1079,1113,1170,1122,1024,1133,923.4,1078,958.2,1132,1212,1041,967.9,1202,1194,1054,1167,1195,1191,1132,1188,1121,1221,1264,1450,1180,1131,1232,1133,898.2,1052,978.4,1130,1036,1115,1049,1086,1153,1153,1064,1177,1216,1028,874.8,1344,1162,1032,1105,1371,1100,1094,912.1,1227,1049,1037,1260,1148,1046,1231,1165,1317,1114,1183,962.2,1057,1148,1098,1162,1195,1187,1049,1146,1228,1179,1102,1157,1040,1038,1132,1007,1115,1132,1123,1132,1097,1304,1186,1184,1206,1086,1092,1088,964.3,1074,1142,1139,1212,1229,1121,1164,1051,1010,975,1077,894.8,1204,1091,1025,1077,1051,1224,1111,1161,890.9,1148,1028,1068,1080,1096,1048,1076,1112,1111,1079,1161,1053,1114,913.8,1127,972.3,1343,1144,1161,1086,1071,1225,1109,1043,1102,1247,1177,1226,1121,1053,1033,1055,1116,1127,1016,1184,1244,1020,1276,1155,1051,1118,1152,1156,975.8,992.3,1070,1186,1123,1058,1293,1118,1188,1080,901.8,1040,1045,916.5,1183,1031,1110,1119,981.7,927.9,1194,1124,1180,1218,1090,1226,1174,1121,885.7,1119,1188,1039,1068,1002,1014,1100,1162,1166,1108,1210,1102,1154,1178,1009,1118,956.2,1207,1130,1098,946.3,1150,1117,1143,948.5,1041,1047,992.5,1050,1078,1117,1039,1172,1084,1322,1177,1136,1202,1141,1208,1248,1170,1205,1065,952.9,1067,1078,1187,933.9,1214,1086,1044,1123,1138,923.2,1144,1153,1219,1070,1159,1165,1155,1030,1076,1138,1189,1126,1068,949.7,1094,1217,1121,971.6,1004,1060,1011,1246,1199,879.3,1029,1014,1165,1289,1194,1128,1108,1025,1007,1125,1134,999.8,1205,1023,1080,1092,1004,1026,1088,1025,1211,1030,1000,918,1127,1195,1049,1173,1018,1040,1209,1069,970,1090,1086,1261,1080,1108,1018,1070,1013,1243,1192,1375,1237,1036,983.7,1092,958.9,1113,1298,1098,1160,1046,1099,1165,1048,1159,1033,1157,1121,1377,1104,1136,977.7,944.1,1067,1176,1240,1012,1283,1186,1080,1095,1032,1024,1117,1112,969.1,1272,1078,1147,1048,1187,1170,987,1063,1159,1116,1044,1020,1335,995.7,1086,920.9,1287,1123,1052,1103,1062,1068,1088,1125,934.4,1158,1111,973.6,1246,1058,1231,952.5,922.1,1007,1077,1002,992.2,1035,1052,1052,1093,1256,1004,1178,957.3,1197,1082,1228,1287,1251,1132,993.2,1026,967.9,990.1,990.5,1132,1100,996.4,1152,1025,1064,1201,1140,1106,992.5,1158,1314,1083,1110,1301,1138,1234,1006,1155,1166,1090,1150,1156,1097,1077,1011,1053,1086,1036,1065,1138,1139,925.7,1258,1228,1150,1087,1193,1145,1339,1005,971.4,1088,1155,1130,1197,1044,1163,973.1,1226,1151,992.6,1103,1166,1132,1096,1052,1124,1103,980.8,1040,990.9,1018,1197,1149,951.1,1205,972.8,1102,1067,950.5,1038,1111,1277,1158,1006,1309,1159,1007,964.3,1106,889.8,916,1212,1121,966.7,1009,1158,1033,1146,1097,1153,881.5,1116,994.9,1039,1105,806.3,1096,1215,1154,1037,1014,1231,1027,1099,1097,1061,1143,1062,1088,968.8,1347,1163,1111,1289,1128,1029,1123,950.1,990.9,1131,1163,1120,1065,972.4,1142,1085,1392,1039,1284,939,1231,1140,966.2,1092,1120,1270,1047,1159,1245,1329,1113,1022,1034,1027,1019,1015,1137,1209,1122,1218,1099,1181,978.5,1026,1077,939.3,1099,1076,1056,1057,1073,1084,1008,1095,911.2,903.5,1187,1080,1177,1344,1160,1026,1337,1246,1268,1097,1156,1127,1096,953.3,1053,1114,1157,1148,1146,1230,897.9,1031,1061,1197,1366,1079,803.6,1111,971.6,1225,1097,1112,1092,997,1162,1141,1081,1379,1054,1003,953.6,1086,924.2,1195,977.3,1219,1240,1117,1091,960.5,1207,1169,948.4,1313,1028,1127,1160,1133,1075,1246,971,1166,1217,1216,1078,1093,1285,1148,1046,1174,1068,1203,1115,911.7,1088,1049,1117,1217,1103,1176,1167,1217,1279,1137,1090,1437,982.6,1100,1088,1107,1158,1069,1100,1079,1091,1053,1086,1020,1044,1175,982.1,1142,1147,996.6,1194,946.4,1271,1166,1016,1010,1207,1022,998.3,1061,1183,1159,1079,1186,1210,1076,1061,1075,1161,966.6,913.8,1209,1086,1285,1128,982.7,1124,1109,1148,1109,1297,1211,1123,896.8,1174,1103,1265,1191,1210,1168,1056,1284,1085,1166,1174,1049,1262,986.9,1142,1088,1049,1056,1071,1298,1113,1173,1075,1096,1032,1180,1113,1057,1159,982.6,1053,996.9,1074,1005,1010,875.9,1200,983.8,1136,1024,1033,1112,1206,1045,989.7,985.9,1194,1124,1091,1071,1030,1179,1170,1265,1128,1025,1121,1077,1213,1047,1106,1068,927.9,1059,1444,1273,1020,992.6,1004,1093,1176,948.2,1109,962.1,1004,1119,1027,1104,1180,1145,1070,1162,812.7,1307,1282,1182,1136,1146,1188,1224,981.5,1135,1167,1240,1331,887.4,1099,1098,1201,960.8,1051,1017,1126,1155,936.2,1181,1275,1133,1022,1108,1059,1239,884.2,973.4,1119,1149,1054,956.2,1122,1120,1034,1218,1270,1270,1168,1014,975.1,1001,1159,991,1100,1066,1113,1042,1280,1042,1088,1004,1159,1125,1180,1099,1187,1134,1065,1106,1007,1188,1104,1090,1037,1047,1148,1107,1006,1186,1088,1051,1080,1225,945.7,1107,1201,1034,1195,1075,1175,1044,1135,1139,1214,1071,943.6,1009,1219,1030,1087,1014,1302,1111,1122,1206,964.7,1149,1234,1057,1178,1128,1186,935.3,1172,984.9,910.4,854.1,1063,1045,1169,856.4,1005,1148,1087,1259,1002,1209,1089,1218,1233,1179,1137,1136,967.4,1161,1035,1121,1132,1119,1110,1216,1012,1113,1178,1139,999.3,1065,927,1023,1029,1094,1022,1024,1225,876.3,1016,1220,1125,1083,1062,1214,967.4,1250,1108,1024,1101,1125,1078,1145,1069,1208,1079,1115,1180,1076,1131,951.1,1023,1033,1027,1101,1102,1049,1128,1022,909.8,1076,1136,1123,1204,1148,1107,1150,1200,1008,1054,967.9,1124,1235,1065,1166,1147,1326,1156,1307,1164,974,1108,1191,1246,1084,1202,1079,1219,1064,1264,1021,1152,1147,1282,1174,1123,1036,1012,962.4,955.1,1080,1250,1198,1057,1165,1174,1147,955.5,1115,945.2,1188,1249,1115,968,1095,1151,1312,1258,1036,1128,1096,1051,1172,1149,1058,1058,976.5,1120,1025,1037,1098,1045,1110,1046,1092,1164,1066,1069,1080,1155,1054,1260,963.6,1174,1151,1070,1032,1183,1142,1106,1075,1066,1192,1287,929,1097,1059,1010,1206,1160,1178,985.7,1029,1233,986.5,1181,1119,1200,1185,1178,1234,945.7,1208,1233,1245,1112,1196,1050,1095,959,1191,1145,1073,1063,1101,1073,1107,985.7,1114,982.5,1222,1068,1201,848.1,1068,1141,1021,1142,1284,1064,981,1029,1123,1229,993.9,992.4,1191,1170,1132,1047,1123,1133,926.5,1058,1221,1046,987.8,1065,1239,936.9,1100,1121,1204,1233,982.3,1199,1049,868.9,1041,1190,1122,1031,990.2,1099,1054,1169,1216,1185,1104,1026,1185,1246,1117,1161,1156,1007,949,1095
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": {
"simulation": "Lightbulb Lifetimes",
"dataSetNumber": 42
},
"ticketData": null,
"completionTime": "2021-03-05 11:20:29Z",
"serialNumber": 6029
},
"signature": "VBKhv07TxKxkfBA0TWaYRMagvGUGjNiwZItksiodXeyBh+ur3uFQoxqkBz+r+DcPSkqcsB52ht9GYPQycLiF/2cuYEbFj5hl4jFAmOI0FCoekWpEzwaGwFUWticVtizmsYU6J85eBXtYzbONQ8XK2/laz1DMJwmu/soNeN1lAY06TGud2itLtt4l8NsERuT/SCT3fdVkKT4Umt5Fd8JKS3GYKXQxHXpe3lk6/ffToSSe90bndcpeo2fIzg95+ysSXltPep5FuxsGjH1+CwUSrRtDOFjL94t3BVhf+MXNVtoxd+wTKYh6FH7V7kf2La9i1nFiztsU6dV2Zi190XGxgW8l38qLP79UBcv5GQ/aBPwEs+bkYtjuIE2XJMSrVUBz2f4j06NWEqY5dQNuIs8+wVRyrRGGACyHabwgtI2YoSLWqzPQqw8g82Tfpafz0hr2sv0NFXYcb2fY8ly3lTJ+NO3CrLuqGu7tG+uKBrwv672fSI6NjbYsp/kzYDu+VHslP/Ni5cCKQL/Xqs6lCaAPbCN004D5T62MKnOCsC5ws58kFvv1nTylD9dxFOysTxar3Gxt3fGfgYbKlPChg/kgQkGgfkHrgtJx4MdzK5vv7OFoim9snCNLsUmWaLpUzt9kt0vhEgCh7lJB8YTADb5jNn7ZnCLLwXNQ5rvh7nooOzc=",
"bitsUsed": 26575,
"bitsLeft": 142949,
"requestsLeft": 991,
"advisoryDelay": 1650
},
"id": 27896
}
The method, n, mean,
standardDeviation, significantDigits
and userData parameters are the same that appeared
in the request. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without
disclosing its apiKey. The random
object contains the true random numbers (in the data
array) produced. The license shows that the values
are licensed for testing and development only. The
ticketData is null as no ticketId
was supplied. The completionTime specifies UTC
time zone (‘Zulu time’) by the letter ‘Z’
after the clock time. The value of the serialNumber
field indicates this was the 6029th request to be completed with
this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests ten random numbers from a Gaussian distribution with mean 0.0 and standard deviation 1.0, accurate up to 6 significant digits.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. In this example, we specify a ticket that was created
with showResult set to false. This means
the random values returned in response to the request will not be
included in later responses by getTicket.
{
"jsonrpc": "2.0",
"method": "generateSignedGaussians",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 10,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 6,
"userData": null,
"ticketId": "57f5c9f390567d89"
},
"id": 15285
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedGaussians",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 10,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 6,
"data": [
-1.90624,
0.541191,
0.333726,
-0.668267,
-1.42044,
0.332199,
1.34045,
1.1441,
-0.677115,
1.94806
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "57f5c9f390567d89",
"previousTicketId": null,
"nextTicketId": "fef8a68874710941"
},
"completionTime": "2021-03-03 10:56:59Z",
"serialNumber": 6013
},
"signature": "19c83cB3hdqjq0PhxqwUFheDfxG12HbvThV1GXlYRRkUC2LjszUffohXtTGsRZ6O9VvGO6zQ/3yxAGUsJK9wa8NmlNnHD7b9WCZOB7R+/lU75/cjCZ3+T5zGpLDNubu/TMyaeE9MweT2RwHcUoqzyx4PhOTpnXsQv8abmLsmEVnLbKngoIu5kUovas9CwrMkbEsNbE4AyOki3GdhA7JJNov0P+xC0I/yfXQl3FZ2+RCPtd0qAjSsj40qHWPvW11yg/uH4hlGkQO4f2I2TGoXYOqJoSnQJa07ES7dShF/qTYXCU6zNCM/NrILPg5u1h1NuLav+dRZlUDMSABK8pGdM35C9X088B4Glva3bgUab4Gp7Of9Q/+TZP8cTZcuTut6/V5hEHaqXIJ9cD35O3aLuh3Fl40xCf670Z8c0/eRDob0UGZQi3MZoNL58Qrcfvpuvrs+Jo8Ug+20/w+FyXWjdz5YiAtsf0bD3Wmgy249BgpRC0/RwGJPdNWBsMRD31AMKo/jO293pa+KxKB3jx3JdM/OmRkY9M446qKVWjH4ZFnStPpMGicpVLhJfBFRiB39azQmVXNkHuagdvBPXliWbLkTARauZB5evpazASPMprNyvCRbj2C66rQEC5oL028cMTvd9NELmogdi964L26lU4xRDoPM82pox0hChSudrZs=",
"bitsUsed": 199,
"bitsLeft": 249801,
"requestsLeft": 999,
"advisoryDelay": 1640
},
"id": 15285
}
The method, n, mean,
standardDeviation, significantDigits
and userData parameters are the same that appeared
in the request. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without disclosing
its apiKey. The data array within the
result contains the true random numbers produced. The
license shows that the values are licensed for testing
and development only. The completionTime specifies UTC
time zone (‘Zulu time’) by the letter ‘Z’
after the clock time. The value of the serialNumber field
indicates that this was the 6013th request to be completed with this
API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId is
null meaning that the ticket that was used for the
request is the first in a chain. The value of nextTicketId
contains a newly created ticket, which the client can use for their
next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining fields
in the result indicate how many true random bits were
used to satisfy the request as well as how many bits and requests
are left in the client's quota. The service advises the client when
it can issue the next request, after a short delay.
Like Example 3 above, the following requests ten random numbers from a Gaussian distribution with mean 0.0 and standard deviation 1.0, accurate up to 6 significant digits.
The client specifies that it wishes to use a ticket (see the
documentation for createTickets) that was created
previously. However, this time, we specify a ticket that was
created with showResult set to true.
This will allow the random values returned in response to the
request to also be displayed by getTicket later.
{
"jsonrpc": "2.0",
"method": "generateSignedGaussians",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 10,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 6,
"userData": null,
"ticketId": "9273cb7c96990c4a"
},
"id": 18591
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedGaussians",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 10,
"mean": 0,
"standardDeviation": 1,
"significantDigits": 6,
"data": [
-2.48923,
0.0727246,
-0.891047,
-0.0678825,
0.34924,
-0.0802028,
-0.0922763,
0.0834918,
0.690368,
-0.628161
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "9273cb7c96990c4a",
"previousTicketId": null,
"nextTicketId": "94e7e5ab4da5c64f"
},
"completionTime": "2021-03-03 16:29:51Z",
"serialNumber": 6017
},
"signature": "As1AW/Mc5Ucaqgp1bfqn1gBsPypjsegrD4nncscRcmVqVjVbdJdpPgOqeAQ1YLSya/PQXoOvVo9/Yw9Fira+8dvxWHErLyM6Y9t+OWDCBYbw+Y5hmUtIqsohZV8EF7FwBRutRlKII+qMZR6EA2LghS+M2guNvEJu5meiK9B50l6yhAPtvYBQIZ/6n/t22WsGrFAt74FkbOzl1VGMW9RZwKPudMtQbDaGyoCwdHnJwIHnp04aIhSGaH4coYvS3gNucK9bP8VROY9y6j8sP4IzLYZ6QhwSqssxth+HIakC1ySQfCG4e4RcI3ZLAZBonBv1dIOV9dQdjyhH8BKLe0TDW0zNx+ynKP77qzdhK1Ew0VHdL75e2KFSaMiB442joNCRHgo3bRoRkp94hiS5AGU/DmKK8ZBDUUtyrZbYDKfF7leZtnqt3VXt2exo2cv1T/nkknI3UFCPWPPHAvz0sN+vSUSwx/rURZmGT94Kbh929HxvSI+TDlYf5h6NGbjTRD299cQYDyXIXRRId4Zjc5gcMV1XF7IJk0um3ss+VpKzqshG2KbcjzG7y3wUnG1twec3TlpIJOUJ5ZYAU8MGGBcNe/lcKaNyAgckRwKzPPO453F83B/zF2bXCKc8GIZvbIIaDsGSTkfebTjK1USanIIBAJsowt7CwZeLB3BxYdFpECk=",
"bitsUsed": 199,
"bitsLeft": 248751,
"requestsLeft": 995,
"advisoryDelay": 2440
},
"id": 18591
}
The response is very similar to that discussed under Example 3
above. The difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
generateSignedStrings (method)
This method generates true random strings. Your client must
set the method property of its JSON-RPC request
object to generateSignedStrings. The request must
also contain an id member, which will be returned
in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynlengthcharacters
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
replacement (default value true)true) will cause the
strings to be picked with replacement, i.e., the resulting list
of strings may contain duplicates (like a series of dice rolls).
If you want the strings to be unique (like raffle tickets drawn
from a container), set this value to false.
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the strings were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
n, length, characters,
replacement
params
object. Values that are optional and did not appear in the
request will appear in the response with the default values.
The reason these are included in the response is to allow them
to be signed by RANDOM.ORG.
datalicensedata can be used.
The API key owner selects a license for each API key created,
which affects this field in the responses generated for this
API key. For example, an API key could be licensed for
non-profit use only, or for commercial gambling up to a certain
prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response with
the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the corresponding
hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature properties,
such that they can be shared publically or with auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests eight strings of ten characters in
length. Only lowercase characters from the
English
alphabet are allowed. The replacement parameter
is set to true, which means the response will be
picked with replacement, i.e., can contain duplicate strings.
{
"jsonrpc": "2.0",
"method": "generateSignedStrings",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 8,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"userData": null
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedStrings",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 8,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"data": [
"lrbpfackfo",
"gjbfdwwfdi",
"vqkdnephfy",
"ujyofunfvg",
"mtlzvslzvq",
"ijbecasvhx",
"vbfmnywldf",
"fnadmyxbmp"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 10:14:31Z",
"serialNumber": 6023
},
"signature": "n9nOA3F9ePibPVqB9RjJF7cFfqE5J9sCbzhD2HCQA5CwgcQR0e3pUyTnapP4UfNPc6Xkc5GtHt1kSl096S2QrCRlqQ04j4lnPYeLSOfm8nPq3aosgxVEeMBc7e/v6rLHYQjCYMZT14Vm+2AjV90tbPr7s3z2FHFj0iqucMZhbl5vL4P+RJsIFYlqqQosYcCU1gH52t6+HKVsDdlb/NxoyNsSAlgVmUelqJZQubHFzfZS+HCtM2ghrHSNXX+UzG5avT4LwXlfB9BsRK1yYDUAt7wwuL1rLh5cTvwG7mDOUU8Ng9Sajd3yxP8rSaQm1M2afQea1to6pAR2AUDRwOJdCwgD3FTuziVAMmf0GjnyLSr+Rn+4cL4jJT8CwVD9eJt+o0nKM7sf/MQ1UWRnnZguWP5IsYoCixcTfrdHP0xIt6///U8hYObHk5R6Y1eA9hwk1JPcXkdYfNUp23ImqtF7DxQvIOcKITF3+UGS3enpZCM4nYmdVGvQ50YZjgt9ZA5VrZwqkoXtPPcEyCfzolRC92S/ZVAnPaMN5p1UszefgVWWDYizgoipyerDb4QRyGTuzvxyciSzaz3PRXKCFqwEyEs5pSpLwEdizsQxl6nZl1Sv6ovJpvhv1JP7ZiYI0t6JeJKpXH/+PCREKkWBWPtR1GRdndQ89FHIqKD4yeNt8/M=",
"bitsUsed": 376,
"bitsLeft": 196474,
"requestsLeft": 997,
"advisoryDelay": 1530
},
"id": 27896
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random strings. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without
disclosing its apiKey. The n,
length, characters, replacement
and userData parameters from the request are included
too. The data array within the result
contains the true random strings produced. The license
shows that the values are licensed for testing and development only.
The ticketData property has been added with its default
value of null because ticketId did not
appear in the request. The completionTime specifies
UTC time zone (‘Zulu time’) by the letter ‘Z’
after the clock time. The value of serialNumber shows
indicates that this was the 6023rd request to be completed with this
API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests ten strings of length eight. Allowable
characters are all letters from the English alphabet (uppercase
and lowercase letters are treated as separate characters) as well
as decimal digits and a few special characters. The
replacement parameter is set to false,
meaning that strings will be generated without replacement, such
that there will be no duplicates amongst them.
{
"jsonrpc": "2.0",
"method": "generateSignedStrings",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 10,
"length": 8,
"characters": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&*",
"replacement": false,
"userData": null
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedStrings",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 10,
"length": 8,
"characters": "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&*",
"replacement": false,
"data": [
"92l8nM!k", "c7y6IEOA", "GV9zvG78", "Niu1Ia6L", "COxJo9s#", "H6MEAS8l", "4cp$IPJJ", "IxBrlcRU", "wtbSgmsQ", "LytsT#Xs"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 10:43:06Z",
"serialNumber": 6024
},
"signature": "kXhMxnd4IOSV7HSkmmnfK4bZ08uu53AW6hqd1ryz8zuSLOus4U7bsUTsmuuoW9W61OJQkNEe4hcis4GAwjHu0damdmX3c46u2hS86KpTmkB3YEC7eMves9KZSm+mXKaQFXq4YQsST21OItVMyYb154UedkjlJNitwbfk1GH0sj913tlgFqmDoPaYizCjhdWOJwF6WPz/nnFeWIa7Fv/xcr4StyXy9lVjecyR5kzHySl/ayGsj1/3tM0QUjy7GLlQRYbOs7IoGVqXTFUUXWO+nA3voNyM0/ztjE6KyYofPMVn+kmcA6iNmAV3LoeQtXxyKeqO22tjWRsQ9TmRG+xAz03x/UfU7nlMRkJ6qmMAfai2f4choofhHZXFdBsTv6EeQqVGXSZzUYDevAS40UOnZ6aiKx3KR7CTlDIFm4FrlpaPgVkHgKNwMPtSDn1SyqnqeIvReUdPjFRbG8YWkxS7bbYufiFzwE0+5xlSToQY9nfm8Gfo3db84WNni1k5ipGqKmCZg7CL0uARqh8E8fGNdJTr9gYgeGHFHXzNfSMUkv5TGDZjXWH1r+jFbX+2ZC5yojsk5olYLV0Cs+dYP+rmdo7oElEfBtfqc6Ikncw6PEb5v0UDm1i9Nv2PMvxjoscHZfAsQnmA0ArYXM5pJJtGLylyeA7bUHx5A1x+3/FDnto=",
"bitsUsed": 487,
"bitsLeft": 195987,
"requestsLeft": 996,
"advisoryDelay": 1900
},
"id": 27896
}
The method, n, length,
characters, replacement and
userData parameters are the same that appeared in the
request. The hashedApiKey allows the client to share
the full contents of the random and signature
objects with third parties without disclosing its apiKey.
The random object contains the true random strings (in
the data array) produced. The license shows
that the values are licensed for testing and development only. The
ticketData property has been added with its default
value of null because ticketId did not
appear in the request. The completionTime specifies
UTC time zone (‘Zulu time’) by the letter ‘Z’
after the clock time. The value of the serialNumber
field indicates this was the 6024th request to be completed with
this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests sixteen strings of length four. All
characters from the
Danish and Norwegian alphabet are allowed. The
replacement parameter is absent, which means the
service will use the default value of true such
that the strings will be picked with replacement, i.e., duplicates
are allowed.
{
"jsonrpc": "2.0",
"method": "generateSignedStrings",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 16,
"length": 4,
"characters": "abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ",
"userData": null
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedStrings",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 16,
"length": 4,
"characters": "abcdefghijklmnopqrstuvwxyzæøåABCDEFGHIJKLMNOPQRSTUVWXYZÆØÅ",
"replacement": true,
"data": [
"esIæ", "afbv", "jqzt", "ZVhY", "ÆQlJ", "KWXÆ", "øUOx", "dÆvH", "Uzkå", "Mpfy", "ivZh", "lENf", "vkYq", "TzTN", "itXY", "NScÅ"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 10:47:06Z",
"serialNumber": 6025
},
"signature": "IaL7v56rgzzQEQsbFkinWTe6Az6N4dyCBok+M3JiOS2bjkzx0ErfPnqAlUiK1xS/JknEFmk2ZCliGuVFcO2gctDqyRJfcr86RHGYM7y684a14JzZkTM6UqYRTho3gz7QMAJJkud1tsKmhWB4oh3qRl6ARUf2kYcAua1PCHo2FohLSwxHfguFmGY0UZj+LAmwMNh+QVPAjSmcZUtxn3Y5yCaCkXbe3J6eILODetCkEEWFBW1yrrDLTaTQmExUwSAS3Skw3b++wm599UFD/koPSIlcn2L9JTytjGbIhfBeGx55ug66vxuPsgQCW5G5LjO81mrhPbXmxPgAcoqiwaVvJr58xR4WqzTNWY/hDe3xY2Kx2DpRLNEuxjEjmdtTb1O2C7uP8dv3qlT7PmDEUeqZoyzsWC9UGijoPHzaJA3kzwho9HCmEl1GTXHBJOON/7b5PXhnZ1BKG6kRECYf8BnFzUQXj+BaetsnLmO4j+G7IsC+/9Jb8ZbivmbQVLUjnL9s6Ap95rP5tqGczlrvY4kn61t0tYLCqYFF0Y0SKXXJHJLhWnOpONUAbFsNKDTTVqy8bksd9JsxRHKAXMOHiYPMW8RMjQG0Fzv8bPhEOhTWRc36gONUfhdn0A2TpO0nng+9IsymqJYK7V2JHGEoUJJBFejWsZwZsFx/jr8NxXBzqvU=",
"bitsUsed": 375,
"bitsLeft": 195612,
"requestsLeft": 995,
"advisoryDelay": 1790
},
"id": 27896
}
The method, n, length,
characters and userData parameters
are the same that appeared in the request. The replacement
parameter was not specified in the request and has therefore been
added with the default value of true. The
hashedApiKey allows the client to share the full
contents of the random and signature
objects with third parties without disclosing its apiKey.
The random object contains the random data generated
by the server. The license shows that the values are
licensed for testing and development only. The ticketData
property has been added with its default value of null
because ticketId did not appear in the request. The
completionTime specifies UTC time zone (‘Zulu
time’) by the letter ‘Z’ after the clock time.
The value of the serialNumber field indicates this
was the 6025th request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
Similar to Example 1 above, the following requests five strings of ten characters in length using only lowercase characters from the English alphabet. Duplicate strings are allowed.
The client specifies that it wishes to use a ticket which was
returned in Example 3 in the description of the
generateSignedGaussians method. As the first ticket
in the chain was created with showResult set to
false, the random values returned in response to this
request will not be included in later responses by getTicket.
{
"jsonrpc": "2.0",
"method": "generateSignedStrings",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 5,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"userData": null,
"ticketId": "fef8a68874710941"
},
"id": 15285
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedStrings",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 5,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"data": [
"ususohiffn",
"vqhdbfclyn",
"wetuzabcax",
"clmwwogjrz",
"tgdgjfzkmf"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "fef8a68874710941",
"previousTicketId": "57f5c9f390567d89",
"nextTicketId": "d45c33af77e1ef6a"
},
"completionTime": "2021-03-03 11:00:47Z",
"serialNumber": 6014
},
"signature": "Ch3edjBjDMGmKAfqSCVlkYrv9/Gx6M0aDKSexut/CFEgektQaG5C3i/Xs6tTmjGbrBUi2JAV9oe+SBDlfncX6rdL92ZY6S15lvykOJ6SbmpfnV7vokbl8+UbzWFC+FUfiJWw0ZY0xcCKo9bXNnAiNlBhylCcjwNHrVBbNGNJvxrgt6mMaD74WiyewYrvPGjEMH8PwhahlFZ3CEBcrCgNNc3ikuB4KY3V/g4i2bQaWIz5WCmDFDHK+n2WoPqDjJQa7Nadkqmny4LgwgxEBNHTBnFTGfhBVDqAB5Nc6NledjWUCROl3BPKeZUbqa3aDX/TIIpnPXSnfJHxAn3sFPiZnR5HbIyQINve3gbTaqsWocnC0jsi+O+7Lq7HwOeOjmMlXELg/dTL+pnqkLQJit0lj6J+7u4HE6516ARAmQltGoCxshwrSCcn24CSyC70Z7cljRYPHeqLmVwEHtpBccWAbs4ChKT4Dp08WajAGK8i/XqogcOq3kGUVsqMdbX6aFBpEfJVOCOIElGEKGTNlmreNuQb/CeDCKZTqjvGX/baNzKAJ1lEPF8wjNLluTRCYgEJc6RBy8mI2//ADLrAjM5qllCDM3gluH/hNsfN+xG+WANXFw+LE69sN8+eS/dWnAqPnztBJj1ZS4IpdnNaC+6OCoG9wLuVXx8nM0vDdD0fjZM=",
"bitsUsed": 235,
"bitsLeft": 249566,
"requestsLeft": 998,
"advisoryDelay": 1120
},
"id": 15285
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random values. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without disclosing
its apiKey. The n, length,
characters, replacement and userData
parameters from the request are included too. The data
array within the result contains the true random strings
produced. The license shows that the values are licensed
for testing and development only. The completionTime
specifies UTC time zone (‘Zulu time’) by the letter
‘Z’ after the clock time. The value of serialNumber
shows indicates that this was the 6014th request to be completed with
this API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket identifier
and it will not be possible to use it again in future calls to the API.
The ticketData object contains two other properties. The
value of previousTicketId contains the identifier for the
preceding ticket in the chain, which was used in Example 3 of the
generateSignedGaussians method. The value of
nextTicketId contains a newly created ticket, which the
client can use for their next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
Like Example 4 above, the following requests eight strings of ten
characters in length using only lowercase characters from the English
alphabet, while also allowing duplicate values. But this time, we
specify a ticket that was created with showResult set to
true. This will allow the random values returned in
response to the request to also be displayed by getTicket
later. The ticket was returned in Example 4 in the description of the
generateSignedGaussians method.
{
"jsonrpc": "2.0",
"method": "generateSignedStrings",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 5,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"userData": null,
"ticketId": "94e7e5ab4da5c64f"
},
"id": 18591
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedStrings",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 5,
"length": 10,
"characters": "abcdefghijklmnopqrstuvwxyz",
"replacement": true,
"data": [
"idaqvfxoqt",
"ycngcljjaa",
"hnpqpsjisb",
"hrsuxpuuww",
"wmrqglvryu"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "94e7e5ab4da5c64f",
"previousTicketId": "9273cb7c96990c4a",
"nextTicketId": "97ab4298586171a9"
},
"completionTime": "2021-03-03 17:09:14Z",
"serialNumber": 6018
},
"signature": "R5oH4wfhOPxGd8gamuxGx4Q6wiZRhhUTZc1BUr25S7IbbUuhx1q+KgHkv360YZvUEW0H61Y/ev5Tlygtn7gLCHDp6V0wVNVo0l22GtzGP43L+M+Qp8Nf9XVPjoBNNaPzxCRStkI4JXhHIaRTuZ6sHxhUzSq7qogXn2haGi0X7UHj4fWq0VfkiYXgKhAlM908WHcpDaBmkbFrLOwPhThNIqIh2DIIW6ru5qsd4Qc1h8hZTSNq3u5f7xe1gHkuwooaPEvKmAZIQCjk9PgT816BZNbguBFvp1kLV3HYZcvF8Y10UTDvmQ+NhYDlgmI+DsVqhSAuMU17Bn3dUUBONG7gm1456qJ6+1hSgdsHpG/kO5X0m7T33OM6L365r8jOiJzvCCD/eBk1d6JHBYMlke6k6cTWfrPZbZ+od9S9YAW/q+seb6hopSYibGGR9lbJTPc8j/+EuVcA1xkA7fXf+ZtBOQ9kgnefpRiqgi+GzxQWGDm7lRjyoWa1OyPC1+Y3BeEJGdQWPTDVphugRWU+cg+7MnRHQqNMs5/Ip6j0RvA5026qRNEZOG16991exGB2VqVZYysmY5lWnwF6kWoE7ipvkClcutN/DIXRGBNk6tnRvYkYs8RWnk4u/kaSXtILQWP+KYc2RoVKmSzFW94U7mqZvdX0wvzUC16XCbZDBE3ph+g=",
"bitsUsed": 235,
"bitsLeft": 248516,
"requestsLeft": 994,
"advisoryDelay": 4080
},
"id": 18591
}
The response is very similar to that discussed under Example 4
above. The difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
generateSignedUUIDs (method)
This method generates version 4 true random
Universally Unique IDentifiers (UUIDs) in accordance with
section 4.4 of
RFC 4122. Your client must set the method property
of its JSON-RPC request object to generateSignedUUIDs.
The request must also contain an id member, which will
be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeyn
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the UUIDs were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
nparams
object. The reason it is included in the response is to allow
it to be signed by RANDOM.ORG.
datalicensedata can be used.
The API key owner selects a license for each API key created,
which affects this field in the responses generated for this
API key. For example, an API key could be licensed for
non-profit use only, or for commercial gambling up to a
certain prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response
with the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the corresponding
hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature properties,
such that they can be shared publically or with auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests four UUIDs. The client does not include
the optional userData parameter.
{
"jsonrpc": "2.0",
"method": "generateSignedUUIDs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"userData": null
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedUUIDs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"data": [
"eea951bc-b077-4c99-b9f0-3e16d6d56e89", "ac1f2b8b-24a4-44bf-866d-95fcccf73233", "9b1ae06f-7797-49ec-add5-7d2f154b4644", "5ef28fa4-6413-44a0-8bea-55660bc104fb"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 10:54:40Z",
"serialNumber": 6026
},
"signature": "hlLp+35WWgnQU4g0ExADOEG1Li4yZG332yfJnaNmAovLqcnuVJkRyFqH9hsx6DHy6BddH1BvLl/veWqQn+iPEyLnMdb0sSOMizpNGHkatdd0B9QhWTiQH4puCym33rp2SAqPZJtXgwkZ1ZZZFuMdY4Vi2snx4EiQ02/R40yhStMLRpCelKJzBZLMfCkRBQchq1nUOelDAccUxHQaGeCiPfp78v1AqsQVCUmmtvgfb0jJf3d2USe6+dQq/IcoPMaNhgBYTyLmh/vaMUH3y0deTs/ld3dW33Ya6gBYQk+pKgLMIJD/c2Z+Wda975eiBNdJ/YEJa9iOPQ2WtSHjoc5UX5nga5/j3XheDh29Ba7NlD8+HJk79qUXX26EPEmYRosbpGFptSSahAckgwFwjFXGLIFE3rNZXAfxcZ66zOgxjKwUQaXda/KW80uHdPRUwJ/oxaO1g5Dc5NjoXg9MFmH3XOvihEHCntW88khkTmWO0A4jsdyytbVoEINWEdWFXlniRjKH/P6x3GOXmjqdPLigT4fb5CwDFAAjLdWw0XnXt0CHzeUDhK5za1BuFhRObgq0LRl+Gh3zcCqqxH4IGlQBvbTvTsQvXa7jshz5fGE6WsyOZnqiyk9Dsh9SdRrqCijWajpxCNKk8CVAp9R+VXMsy/yaKmmUPjhePWupY0yGkoU=",
"bitsUsed": 488,
"bitsLeft": 195124,
"requestsLeft": 994,
"advisoryDelay": 1780
},
"id": 27896
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random values. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without
disclosing its apiKey. The n and
userData parameters from the request are included
too. The data array within the result
contains the true random values produced. The license
shows that the values are licensed for testing and development only.
The ticketData property has been added with its default
value of null because ticketId did not
appear in the request. The completionTime specifies
UTC time zone (‘Zulu time’) by the letter ‘Z’
after the clock time. The service advises that this is the 6026th
request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
As in Example 1 above, the following requests four UUIDs. In
addition to this, the client specifies that it wishes to use a
ticket which was returned in Example 4 in the description of the
generateSignedStrings method. As the first ticket
in the chain was created with showResult set to
false, the random values returned in response to
this request will not be included in later responses by
getTicket.
{
"jsonrpc": "2.0",
"method": "generateSignedUUIDs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"userData": null,
"ticketId": "d45c33af77e1ef6a"
},
"id": 15285
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedUUIDs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"data": [
"992d8093-5ba8-4265-aa2c-ee35167d6a7c",
"756b4912-0d0e-40e0-b161-1b3aed8d1ef2",
"8e328895-b395-4480-bc16-2b1f65e63bda",
"9ea4c3e0-d826-49aa-8d85-dc48231ff558"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "d45c33af77e1ef6a",
"previousTicketId": "fef8a68874710941",
"nextTicketId": "dc24cb1869d3d964"
},
"completionTime": "2021-03-03 11:04:21Z",
"serialNumber": 6015
},
"signature": "3gtSAdZj8+WNtr85JuOI455nH1hX1NjybJCaNCBO/m2ytmbKGvXDh1KST3HDL6Zsj+JZnUYClo9aueWT7hhGau4PoJmuccLVrxORLw9w2ectvT+SogXeICl18Aop5UV563zVhHFVvs4muXpyX04ti1UVtBC/hOVjEI9AHqJdtyOBxD5PrDnmtAjH7GxD91Sr7ele26PgCy+2tR7ftIjpsInLZ8gvg2eBYbkAqwWpo2zh+RH9SeD7zXKMHJ+m3HWRprJIU+5kxOEHR79o7avDkkzN7atIhBl/NPwYeSMpUVsMbxmeNb7MlxyXl8/lmcvm6A72NsiCHfl+c0ggD4wHHp1AcDJILK3McLC75yl7YKeTSOg/QwU/+l1TdKnPZyUBPFP96OxRydoxdNTIHYVeSYeczud41jpOYfInH7EgGxCP2G76+Y3ku5lquX7UHSx0IyqjO7h2TBsNeT+gNnNAPDS7q6nxuaUA9jyIXEFXOIR034BysYVLUEd9GuQ3AtfYRFIYMtg5Ux1QvjeEU5h1EUILD6FhRwCqiceeUzQpwn/kTlvnezWeNYzydTld+EyQYR0IBOR6HaO/NaOKivJe+YVNKUOOAjabiA0ViQnJ3pyY1/IFhDSZX6qvD5xpZ2Yo9W2ivD+3jcO4SCGAGmNLluGCwR/IIBYN36r6kyQwb2Y=",
"bitsUsed": 488,
"bitsLeft": 249078,
"requestsLeft": 997,
"advisoryDelay": 1620
},
"id": 15285
}
The method shows which part of the
RANDOM.ORG API was used to generate the true
random values. The hashedApiKey allows the client
to share the full contents of the random and
signature objects with third parties without
disclosing its apiKey. The n and
userData parameters from the request are included
too. The data array within the result
contains the true random values produced. The license
shows that the values are licensed for testing and development
only. The completionTime specifies UTC time zone
(‘Zulu time’) by the letter ‘Z’ after
the clock time. The service advises that this is the 6015th
request to be completed with this API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId
contains the identifier for the preceding ticket in the chain,
which was used in Example 4 of the generateSignedStrings
method. The value of nextTicketId contains a newly
created ticket, which the client can use for their next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits and
requests are left in the client's quota. The service advises the
client when it can issue the next request, after a short delay.
Like Example 2 above, the following requests four UUIDs. But this
time, we specify a ticket that was created with showResult
set to true. This will allow the random values returned
in response to the request to also be displayed by getTicket
later. The ticket was returned in Example 5 in the description of the
generateSignedStrings method.
{
"jsonrpc": "2.0",
"method": "generateSignedUUIDs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"userData": null,
"ticketId": "97ab4298586171a9"
},
"id": 18591
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedUUIDs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"data": [
"e18528e4-c80b-41d9-8063-f59626adfaf5",
"0e04e6f8-a10c-4a33-89a4-2d1316a01ec1",
"3e9800d0-d078-4f33-a216-6842b79cf8a6",
"93f15728-0bd1-4c63-9137-2f0033d2701b"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "97ab4298586171a9",
"previousTicketId": "94e7e5ab4da5c64f",
"nextTicketId": "775f80fdcda23031"
},
"completionTime": "2021-03-03 18:18:46Z",
"serialNumber": 6019
},
"signature": "LF9g9opJtHNYdGDdFT9XjDOdWq2HVW/CsbTyfe1s2uSMShuWi9RfuxVmVzpxoh9IYhSCUpmBEkuPCWpGS2uxlgdlukixxIe1zMonjSXytRV/VO8UpUJX9R98QPWt7GKvYx/4feNuw3Zy+WsM/8ucQ75vfnrV1rZDAabMqzvl2mJp99QLgro86309BLHKP+yWM9EFeVE40YOcUA3yYDgcrg/xIotCwlSLGIJB7R1Lo72vI63yrE/+X33s+vPjvcguHfHuXcVVX2kS2FYB0ysR81ITxQlQ89G9T5yuqT6w8t/y+Bg7oQrquQlfQEjdaeH3m3qMYWTNrMdgu5zrjtQvmeNZVldI/Z50EaqSIZ2eOxd7DnNetOB4oHyxyNOgBSZhdF7xnQPAxLAq/WfLJP//7IuisuEZszIEQLcowXXrtlRMf+6/wBVX/mcdgQtniSOxEbOAKyUJV4iaDb4+Dwhf8eA28M20VsxEjMcwh+aFBFK4ysSy25kYa5izhxFW8JJSxpTEGI81egVSCo6j+MjFAzuq4FRJUAtmK5l0ncpv2ntMQuTC/jD7M/VOT1qp1tiiFv4I+Oha/l0fUcuEkYAZVa5oKVbwANniYJuakObzayiNAoC6/qQPtt1ofRJd0qm4EFDpF3sppmPO4snlB4h8GlLLELB+HPnars8KSN0z4rI=",
"bitsUsed": 488,
"bitsLeft": 248028,
"requestsLeft": 993,
"advisoryDelay": 4400
},
"id": 18591
}
The response is very similar to that discussed under Example 2
above. However, the difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
generateSignedBlobs (method)
This method generates
Binary
Large OBjects (BLOBs) containing true random data. Your
client must set the method property of its JSON-RPC
request object to generateSignedBlobs. The request
must also contain an id member, which will be returned
in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynsizeThe total size of all BLOBs requested must not exceed 1,048,576 bits (128 KiB).
The following parameters are optional and can be included in
the params object of your JSON-RPC request if you
want functionality that is different from the default:
format (default value base64)base64 and hex.
userData (default value null)ticketId (default value null)createTickets method. Specifying a value for
ticketId will cause RANDOM.ORG to record that the ticket was used to generate the requested
random values. Each ticket can only be used once.
If the BLOBs were generated successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
randomrandom object contains the
following properties.
methodhashedApiKeyrandom object
to a third party and allow that third party to associate the
response with a given apiKey, without requiring
the client to disclose the actual apiKey.
n, size, formatparams
object. Values that are optional and did not appear in the request
will appear in the response with the default values. The reason
these are included in the response is to allow them to be signed
by RANDOM.ORG.
dataformat
specified in the request.
licensedata can
be used. The API key owner selects a license for each
API key created, which affects this field in the responses
generated for this API key. For example, an API key could
be licensed for non-profit use only, or for commercial
gambling up to a certain prize value per month.
userDatauserData
object. If the request did not contain a value for
userData, it will be included in the response
with the value null.
ticketDataticketId was specified
in the request, then ticketData contains an object
with the following properties: ticketId,
previousTicketId and nextTicketId.
The value in ticketData.ticketId will contain a copy
of ticketId from the request. The value of
ticketData.previousTicketId will contain the
identifier of the ticket preceding ticketId
in the chain and will be null if ticketId
was the first ticket in its chain. The value in
ticketData.nextTicketId will contain the identifier
of the newly created ticket in the chain, which will be unused
at the time when the call returns, and which can be used in future
calls to the Signed API. If the caller did not specify a value for
ticketId (or specified null) in the request,
then the value of ticketData will be null.
completionTimeserialNumberapiKey (and, consequently, within the corresponding
hashedApiKey).
signaturerandom object,
signed with RANDOM.ORG's private key.
bitsUsedbitsLeftrequestsLeftadvisoryDelay
For a successful response, the error property is
absent.
A client that stores the results to show non-repudiation or
implements code to satisfy other auditing requirements should
store the random and signature
properties, such that they can be shared publically or with
auditors.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests a single BLOB containing 1,024 true random bits (128 bytes), for example to seed a pseudo-random number generator.
{
"jsonrpc": "2.0",
"method": "generateSignedBlobs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"size": 1024
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedBlobs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"size": 1024,
"format": "base64",
"data": [
"AD+gc8KdHzBX8ekzzUa2bsiCiVo0XbnKCcy2gNBrBUuMTYKwjqWSrcOPxr/JywYcV7PbEwdJAEls3lcQzVz2N7VNO1j1B3WcJOleFdk4f+qI71EQ9xxSp4WUufo40q0hrBWUVD3Zp3LCjI9JEQMSeIazw8sD2mM/NEA+cEU8xUY="
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 10:58:11Z",
"serialNumber": 6027
},
"signature": "I9gRyM4ENmsoogmIPiMC9RjKqsK5YpE5cz2hWM7zaG8pHwrdJrWh3IfK1JIOJhCjKjExJaQAhB62dH2RBMGF9UY+wylui8E423bmPosl3Um797V0tR5Na0Ut4R12opHagHQX13kFQTohJAC1i/ItEl0jgtbmcUSocKZBYxC5TrnmqNG9VG4J/mDzhTkU6lFksQZDi/WcHpvAaxzczYtc+HC5M1mAeXn71HrLs1NWCjIxNQggiFE/2iDEyVkYVo6OQIJcQZlEKKCnS4VNG74uXNHKmlIBb1VW9dQESqNIgt7gmq2FIYgFltMfiRBYO67lo5Id6c5xxAzch9fkNNqGWmLWX5aHVtqtgz8nNF17fGAElCB3lroWUfuwO48Dupz6jZOF06WHA/ZATXG7/kt+RTmRRJBFWHdkfI3e0NFeXkqdUAYUnAxu1Ej91xhh1R70ql0htSJbX3RnyUGId998CUghkzXVfFe4bCry/nE3aHfBhsGOxEIEFDidSKcxBOd5QiKcfyabJa3DTDxxznXPWNYs3f8jx2sQDHStwguDenJPuJyaTPwowSZf9fS+IBMUGGwoR5n6ejycTU/aQLF2biUIZ7w9waiYs0yxWs7S4bfkOd14OuQJ2nWKRVlpJfUlCljN2CBvHj1sySI1SQQDw48h4dC98x7Q2dlt1IVVK/U=",
"bitsUsed": 1024,
"bitsLeft": 194100,
"requestsLeft": 993,
"advisoryDelay": 1940
},
"id": 27896
}
The method shows which part of the
RANDOM.ORG API was used to generate the
true random BLOB. The hashedApiKey allows the
client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The n parameter
from the request is included too. The format and
userData parameters were not specified in the request,
so they have been added with default values. The data
array within the result contains the random BLOB
produced. Since no value was specified for the format
parameter, the BLOB is encoded with the default base64-encoding.
The ticketData property has been added with its
default value of null because ticketId
did not appear in the request. The completionTime
specifies UTC time zone (‘Zulu time’) by the letter
‘Z’ after the clock time. The serialNumber
indicates that this is the 6027th request to be completed with
this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. Through the other
fields in the result, RANDOM.ORG also advises how many true random bits were used to satisfy the
request and how many bits and requests are left in the client's
quota. The service advises the client when it can issue the next
request, after a short delay.
The following requests four BLOBs, each containing 6,144 true random bits (768 bytes) encoded as hex strings.
{
"jsonrpc": "2.0",
"method": "generateSignedBlobs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 4,
"size": 6144,
"format": "hex",
"userData": null
},
"id": 27896
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedBlobs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 4,
"size": 6144,
"format": "hex",
"data": [
"b0e9c18c1cc7b0fea8642c5f82e5234f27bd71239418b6dbc3b1cfbf81c125c6b06e8bf115b940a13524e606aa77d1b3d5cba471d098ff89d31eccce73e6969e8c6a56b43f80fc5f7ec47f4c6efaf8233b3081da4449a8942c4b1ed0d0c81aa3a54e569225da210ff4a8268df4a5b27ddc5ef529873128de3dddfb2a8d4b676668fa91cdd8af3caea61fc3e5f8de107c0d2e079236306cc603f4b6890424ad66918fdd50814bd855b2a626da138e2f2d0310b523947e2ea08fe0f98760a89bad58d1ec7d00047cf8c2fc2ad244202a060c02415c346bf38d92f718a2af594da87712a374bad6327cd827d6012a8d61961ce9a1f39622eca4d9a74e006ee044a5095b61eba0aac0235a44cb47d631947950eb38958bb8986182534fd910caba5323f5e9d6c45749083a29a7c6fa64445ac5f88f2cb21f2905f252faf85c2f5d03ba5306e75d4cb278fd2dbc623107ef80c6fb34dacf989ab1a04edf045b1cf40e2e090faf53b12d18eaed4937ceba84dce00038068451ee141d3723ad72f23db3dec5e179cdf3ed2f3097b2031d5e5f391a3b4aaaffdaabedaea8f121da21d3da27582e827efb48b18fbe1686debff7d9f9c89daf76535ab9d0f198c3a19c1bc87814c7918dd1660258615fbbadfbd7d7c0c160b6e1f03be4d001fc28227cc55a62a2c266fda75fc9f389b65a398a6d46c48870867993fafd0239702e183e0ecce55ac85f38a54c3914f64c1be1bb7402fd6eb4f815d73e2260236a67ff9d024eaff8d1c18e7aac04348b4b212ec5ba86adab53aa4c697bd5c1c69d282d210b09422e207398970bfd7f851b407ac9813c990fc4be0a9a8c193834983a9ecaf02d8332bb6fdf300e8aa821dd53281f835dfcabbe383780ede6f38d8e0519ba47472d8bcf4c8d52ffc6c45f6afb419605a4b360c31b1773ee1f44cd99256e0c85975481cb36ce3fd7be4b6fb4b80a942f1747af70c726b7e9f3deb8bd2ac042131d521f4bd5770584655890dd4c3f312c8161f0377e0081aa96c022845b74c34b86d2303c5f9fd967c31283e88671d80f855d65cf172938d596f1ea532142bbda0e",
"45524f8f966e525a2f12909458ffa383f7c024572fda2af04854b38de612128f34d85000f2b1b590a83a86420a3f63648c86224214db922643fd2154e407e763eadf6e467dedc15d178ac7fb8c6ca43070856f6216b2e3064696b2aaa7dcb976ca86c0e3fb766f79f67e114f7a9b986595714af9441de2c243d854beda7dae5d6c0399f95bddcbdc437843e92ef0db08b3a99c01ad67ea71ee5cb2f0c59a1cf08b9016c3a93d7ffcac908ce98186b330a4e0c0a380b2b6dd0678b62ca390a9d0cf5f090063607bec32856241c801ee32074edfed658be7cef94e63a7f6f931d53c6e5f3cd73853d12cc86e626316fb849ced00954a3a689c7326276efe170ac3c182995f950472fc0c69791633307c1539537b2691ceba92bd50740a808032726342a3f14137375fdc3dabf6d25e1eda43630c2f467d060b811cd6889876ebe86dd832249ddf66cd3e951ae1b1b2488df91f693e7b83f3d4a0cd7238c048906261d67e3cafa38b4fc796dceaf930b89d37f5aad23958a961c9080f5dfc2b9a93f2a174c996ecaf46bb102300cf72240a5862aae828139ac9031fe764042e0a57ffd6732939f5d82c42ba35475cec738273abbda241501a3023b9e7186a86e655acdd1dfcfd7be5843ae551a1fbe7c24979b651b849a3c7da7d6c27550dec0130a43859b94eade9c9f8da49e4391c9e0721da1529d76c363f52dc427eae3d9bd192c52eb357f339078fbab16dfc722c7efbce496e8efdc069d57f471ddbeceb54caf59da4ca21baa7cc54f05bab7fef898b8f7798cccf0d0d44142d0ebd7a436009900a34b3703dae2ddef88e869536264fe2ced71522ef28163dedd65025c0cbc0a92909c8e0f08620534cc6dbc0cb841aa5c55a8abad63af7e5fb73ec84d0d435e2b0eb9d4bad42672d62ff40e14c48bbc8af0d722a3aa2c1f28c55d514f09946c4d8fd143031c321f999ce826010ca62a041163127825438c151b1be442a94115e378cb6c9589beea9c2c23eaafd30ccbff1d514f76466659a72d121f8823979c04a06b824baa22404882571fde7352d840652da2f826fbc9f67e8add82d7f",
"c476651200d402fca24a3c163692e5c98be1c2891678f00e8b154f4219116cefc6b786be8714cf8aabb78bbeb883b75426f3b91b5655722fee77ad3bf990f63481f5a1575ca595833f974b81bf08643702067d42b0729201b5581f4a754d40d65b4f099b396ec287200dcb8197042b07f4bce25f6a93614deefc57244e8804b7bd9807172a244a4439a03b5afe1c458f0f898914e0d04ebf75bd8105d7d535238d040b9f66d51f7a033e73d7d7878f7da6521099b3ab9fdfab91f5af9efa61a9e1697c11236adebed3208a8b3b81ff930a7c0873b80870c6509c774e8cecadd908f891f21ce74262ad4b9715c481cfd107c67f9a888fa3700d273863dbf782a1cb9a0bb1db3974e04ef8d8cd3d3b64820fdde62614d88b88b5ec195cb2fd3b66ea23e268a77a356697ab8bd665597251851bf8eff81da2a38969a93db6c9d337fc6df7cbb62624828bb0a9838a9a9fbc28644bc9653cb4ab52323ea7308dd3c01b32a08d34ad4957a4ca748209c899c3950eb09e3bbb3cec09d4bdb950f4dc2b67da2510264de2e6b7cfd22d539812954115a4b30b782c47020ef9626c59aa992530f4052ec868d316a0f4217815714249099517ac036b0d40019293ea7a21b9a95f54745225def0d965c0b3b33be42823d3ca8a472897cbea7591d723b5497a9110decc4fdd2dd68b0dedf89354d6aedc0069f1f3a7ea13b228c9200aaeea705f7aa5d23891fd96b01494af56da7d8bceca769dd7d4d49388cd36bc8d02dbeba53b4429a69d6ec3622fb11bd7f0331d7367419a7d67d29f66da65dc31f084aa2ae0612f4d94cf9af2a0b9f94eb0e9bc36e9582757d4ee8a8fbe931d581279642cef1a9b5d3bb91a52670b1c83b952fab56715fa577eef0884ff287bdbcba3ace2364f542c81df06afd29039743e7e7ef2e52ee172079fc561174baac90751048b3cd4682ceb6b4c0817c1466f5cb3669d4b53b4a07fb717624d6973a8cb2eb05e0a9e6613a2349f5709c7c1ce970c7e385130dc60a1c5d77b8350dd94602dcb78071cd31fe2fc7c5bd0ee4b3f88bb5037d2b376b6c66945a29391f40b15041d",
"c50771c86e6a3dbb051617db8fc4de99a0a7fb5febb4c730e0f9233efca85a7a3d0101dcb10a0823ed6c164b42e570b3cdcc9bd92b58e8ffc4e8eeba5cfc8259515fd8bf4ddf20e2b87066d6622a43278f0f64277cde87314611d5236c85d55ab20a8fac0fe4c6bc8d00ebd56341826d16a104d4922a28ea1a1d11e9be687cffcda4b3b468ce82a48fcabac8e6fb2ec3e0b9903c36fa381424979354a0b8e83ac21bd72376215b7adb9b439f2407a05ca4e2b793663e6218c6ee8cc7714c1ac882f0e97f40f5ad843f5737b5526d71172acaf5a2ec23b343f612a514fc67bbf406113d523ec3c30e12fd676ea92bd993081ea0cd9165cdd358f6640d460bf7de7293363ab797e1c090b18594bb377b4941b784a921432ae903931fb1b09476d1fad31bf1ec679e7888687e946ef61f99576b80308176e1459bf953cac30f5e692d9fc6a78397e7b77c12d1895f10ccacefc116f659487cd6c1a62e006d1393852a6554468570c3077198daae06b3dc83c377f54619c8c4cc51c2968cc43aad12deff5990bd37b27c10fa92656de3b3a88b62a3ebf8b644b85f1828a3ccb5d809b64aa838a11922de70586ee6a98ab0944d625e3a1d1ca9dd4cc87f93faf3e0f88ff92f05653c8890a70d7bcafc7b6e3f685e412d5e8aec38e8882c2380fa89bd88d500fecd4e43c5af3e0ce66e51be46a42f80080651348d1b02bacb6c201ecf7eb3c7e3b9396ddd465f56cce128e4dfc14ba6bdb8e0d7df34c8ef0a859604a6d0dbdfcf97c46fd5f910c75ac09475b4eca80df83c41dbf75a4f9a7475a74895dda023be5fcaa186b5701a478b5efd8d083e2c50ba22ceb154752de64ad9db476ffada1b1c7c2e197beaa5476529a1b9c01de056e18c119d8683355fac1b347c03659071ee6a8eff58c8c49aec374359bd2a222aa45daf1b2fc4616635c8d48c420e123c05d0c6e5410e325c41514c5f898c71f3dbe397c28b85e72938b11a4ef6e7d4c6872c862ad3ca35663e2b06e77fd6b919c234e7d676b0cee580c3e5188e81fd8bbc7bcf64a1d2783e9c925658d3027116b5bc1f6194b64aa6a0dc5e3a"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-05 11:03:12Z",
"serialNumber": 6028
},
"signature": "rCUhmxIvLLCgc/4sQlb/5t4dAJ3M9XvfXST8vPJN3WQCvRwus53V6YSd/DIYQu/UXTEDINEkhqN8i4iwNekeo56aLjzFemYSQxRfwpT6UYj6iaqAi+T4piMjvxUzryZL4kyBydVBod8UA21D+70f5fCckKr2tiliYdRAwwdj/JAKr1A3zWmy8Vj0Zryg558WR6v8+xbmpBp9ppAJ4D5MgEvmbdS02l6br3ZKXBcCEqYBLiWh3S2b53tQfgeVSF9IM5sTWpR9M/e2FqTq2abAvMvusMQcLbyXIDrcsH70COimSNCRRjtY//Z9cH2Ry/kyEjE7lWfraiKVq5eHP13OrOfaQwrqIPj5p2AD0O4+MLoiVRrQvwt8ia8UzI0d/1FeDsw7VBESJzsH5MMbnu7b+NLINf63X4CCXvai7CkNlfb8+kAuWlrJIhqiFW60mPP1kDqdTsESjj+tybDiZQWXUjPwcOFxLPp7K/zCitrLPBxtvNapq1+B/WDQXNzE/RkIFPyEeRwIZmCjkdW1sazcD7Qla07IB3WEBUodEQYfIs4j6Immu/4oqfeChDG0Ij3/QTsnkfTgU8J4fJYuRcvr84zvDwE5D57PLImD5PZ0v+i+KzvG/KXLHKApGyKeoHr2js6YnuwPJdxJxvZrVqTkcP1P6eAA2D6fXPBRitBEca0=",
"bitsUsed": 24576,
"bitsLeft": 169524,
"requestsLeft": 992,
"advisoryDelay": 1650
},
"id": 27896
}
The method, n, size,
format and userData parameters are
the same that appeared in the request. The hashedApiKey
allows the client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The data array
within the result contains the random BLOBs produced,
formatted as hex strings. The license shows that the
values are licensed for testing and development only. The
ticketData property has been added with its default
value of null because ticketId did not
appear in the request. The serial number indicates that this is
the 6028th request to be completed with this API key.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits
and requests are left in the client's quota. The service advises
the client when it can issue the next request, after a short delay.
The following requests one BLOB, containing 128 true random
bits (16 bytes) encoded as a hex string. In addition to this, the
client specifies that it wishes to use a ticket which was returned
in Example 2 in the description of the generateSignedUUIDs
method. As the first ticket in the chain was created with
showResult set to false, the random
values returned in response to this request will not be included
in later responses by getTicket.
{
"jsonrpc": "2.0",
"method": "generateSignedBlobs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"size": 128,
"format": "hex",
"userData": null,
"ticketId": "dc24cb1869d3d964"
},
"id": 15285
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedBlobs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"size": 128,
"format": "hex",
"data": [
"345edea5c0f1f6a119772bd90eb44ec6"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "dc24cb1869d3d964",
"previousTicketId": "d45c33af77e1ef6a",
"nextTicketId": "bb770b44570e5331"
},
"completionTime": "2021-03-03 11:07:51Z",
"serialNumber": 6016
},
"signature": "j8dv/GE69IjvPARsIbmWzRLfOdeOXcpZ3BktAPVGd8vHAq6DGp8EZUiDL07rhQECHbotB8eu0UgA51nI3nVrjRedq3YZOHOngEMB/yLD/YsTO/pxRkaxoLGobwD2ceIFkjempuw1ukpXZEDTH9f8C2w3wtx5vVa9ZxUZdZTilHOeX42Dpt/L0GMJo4buq00AC+Iq/CJzokx11XlNNGLEI/HNGqkAl18KBq14UZlupFMzOvxJeCzdpDPtA5j9fgF5vygNZw7kAWJHjoa2HinkMZyOqDeDQ/ZMAjmpA8fWQsVP/OSrqdbNmih6l++wHoHbEoYgod7PIOpcATXB/KYkn3kfLbzSQgI8PB5sq48biDrwjn3OZNYPxx70ESBAzhneR5MpfO3e0fLdRe5X3Qxf7UCeaUobICZ4Z1Y7/hqRNmPP1hDtOkDrE0sabhLrVuWRl+cNQt0Iqh/6kzqqga7dU+uxZ57UWVv3rCqSMiGQH5pnCFOu6qTMFkIra7uZIrzxFcJZ5woaEF7z9cYwiQCflZeX2i5C1P/8KYSlDIe2d6aGrhjKKZSTUDhFNVO98mKTVDuJ1aCyLTdQ6ldL3jdiarl0IrLqla9uU1b7SKMapVy7ndNpMznHBgqMmABS4vEccx/4SNk/DJ1ssj/tGnLhzdefjCJvPUCZhPq2OVWFBn0=",
"bitsUsed": 128,
"bitsLeft": 248950,
"requestsLeft": 996,
"advisoryDelay": 1490
},
"id": 15285
}
The method, n, size,
format and userData parameters are
the same that appeared in the request. The hashedApiKey
allows the client to share the full contents of the random
and signature objects with third parties without
disclosing its apiKey. The data array
within the result contains the random BLOB produced,
formatted as a hex string. The license shows that the
values are licensed for testing and development only. The serial
number indicates that this is the 6016th request to be completed
with this API key.
The ticketData object contains the ticketId
from the client's request. The request has now used this ticket
identifier and it will not be possible to use it again in future
calls to the API. The ticketData object contains two
other properties. The value of previousTicketId contains
the identifier for the preceding ticket in the chain, which was used
in Example 2 of the generateSignedUUIDs method. The value
of nextTicketId contains a newly created ticket, which
the client can use for their next request.
The result contains a signature of the
entire random object, which allows the authenticity
of the random object to be verified. The remaining
fields in the result indicate how many true random
bits were used to satisfy the request as well as how many bits and
requests are left in the client's quota. The service advises the
client when it can issue the next request, after a short delay.
Like Example 3 above, the following requests one BLOB, containing
128 true random bits (16 bytes) encoded as a hex string. But this
time, we specify a ticket that was created with showResult
set to true. This will allow the random values returned
in response to the request to also be displayed by getTicket
later. The ticket was returned in Example 3 in the description of
the generateSignedUUIDs method.
{
"jsonrpc": "2.0",
"method": "generateSignedBlobs",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 1,
"size": 128,
"format": "hex",
"userData": null,
"ticketId": "775f80fdcda23031"
},
"id": 18591
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedBlobs",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"size": 128,
"format": "hex",
"data": [
"6e46f94b2097114f7b532bb1e2887b3b"
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "775f80fdcda23031",
"previousTicketId": "97ab4298586171a9",
"nextTicketId": "5797bbc53374ba4c"
},
"completionTime": "2021-03-03 18:21:05Z",
"serialNumber": 6020
},
"signature": "jlDthlWUvyWe2Ev5u4ysFXsaTF8wbJPljGc8pUMNHbl3iK/IJq9beK67LJm9ZEpjB0WXycUvouiziuT6lvNNHd8YbvTfxJYzRl419LRvdF9mf+mGmgPdZWiyLWQsUsF4K4eJYmlqEJWrWEp/2edSqH8H8Tyub7KhMEwYcw34JYIyt1pG8sTdegIIiRYLA0OhwQ6l0FpIxo9oErPOE3tJ9zYoHlSx+reUrpOWy3RQ+oUKdBpauLhg5zU2G+ynd0kgNlMdh2GFAGu68nFwGC5BNeFr153CuRlJP1juxvyDAyGZBUdcI2Jg8bQOoVBD3RrxFFKKGdVo4loFtdOipNh0M9p5pLhj46BNdnizmI4N0oJI6iV9Wp5g1Ckblq9lyK8X79XKypmyu7tOuo098f6TtsapFe38meA9yBdTiQRwCaQjsOpnB0Fl69bKfif9c534eW4bx/lLvIjBFeCibS1g5J/xekmJZBZwgWDXcVfh1FrBSj4dom65mSAiFZFG7tPHhc36uR2pmT0TATv2cW87ne8xtFujtV8z4rXqmM0bKa2r9H3LbrfID6UA2DDUpbI2uQY5MFvMIOjL3eXk2SP5ZnBowcLYRa+dcJweOcJ7PnWglByGMRq9BQcPXT0Vrwto39JqU47TT95iDCKVmScGoiIIu8W7jZa87oMkjy4CGt8=",
"bitsUsed": 128,
"bitsLeft": 247900,
"requestsLeft": 992,
"advisoryDelay": 3750
},
"id": 18591
}
The response is very similar to that discussed under Example
3 above. The difference is visible when the getTicket
method is used to retrieve the two tickets. For this ticket,
i.e. the ticket with showResult set to true,
all of the information including the values generated will
be returned when the getTicket method is used.
getUsage (method)
This method returns information related to the usage of a
given API key. Your client must set the method
property of its JSON-RPC request object to getUsage.
The request must also contain an id member, which
will be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeyThis method has no optional parameters.
If the request succeeded, RANDOM.ORG returns
a JSON-RPC response with the result property
containing an object with the following named values:
statusstopped or running. An API key
must be running for it to be able to serve
requests.
creationTimebitsLeftrequestsLefttotalBitstotalRequests
For a successful response, the error property is
absent.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and Messages.
The following requests usage information for an API key that exists and is running.
{
"jsonrpc": "2.0",
"method": "getUsage",
"params": {
"apiKey": "00000000-0000-0000-0000-000000000000"
},
"id": 15998
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"status": "running",
"creationTime": "2013-02-01 17:53:40Z",
"bitsLeft": 998532,
"requestsLeft": 199996,
"totalBits": 1646421,
"totalRequests": 65036
},
"id": 15998
}
RANDOM.ORG informs that the API key in question is running and advises how many bits (998,532) and requests (199,996) are left in its quota. The response also contains information about how many bits (1,646,421) and requests (65,036) have been served with this API key since it was created (on 1 February 2013 at 5.53pm UTC).
The following requests usage information for an API key that is stopped.
{
"jsonrpc": "2.0",
"method": "getUsage",
"params": {
"apiKey": "00000000-0000-0000-0000-000000000000"
},
"id": 21185
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"status": "stopped",
"creationTime": "2013-02-01 17:53:40Z",
"bitsLeft": 871365,
"requestsLeft": 199977,
"totalBits": 3519123,
"totalRequests": 69274
},
"id": 21185
}
RANDOM.ORG advises that the API key in question exists but is stopped, which means that it cannot be used to serve requests. The service also informs how many bits (871,365) and requests (199,977) are left in the quota for this API key. The response also contains information about how many bits (3,519,123) and requests (69,274) have been served with this API key since it was created (on 1 February 2013 at 5.53pm UTC).
The following requests usage information for an API key that does not exist.
{
"jsonrpc": "2.0",
"method": "getUsage",
"params": {
"apiKey": "ffffffff-ffff-ffff-ffff-ffffffffffff"
},
"id": 3677
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 400,
"message": "The API key you specified does not exist",
"data": null
},
"id": 3677
}
RANDOM.ORG advises that the API key
in question does not exist. More information about the
error object contained in the error property
can be found in Error Codes and
Messages.
getResult (method)
When your client uses the Signed API to generate
random values, RANDOM.ORG stores
the signed result for a minimum of one year, such that
you can fetch it again. The getResult method
is used to retrieve such previously generated results. Your
client must set the method property of its
JSON-RPC request object to getResult. The request
must also contain an id member, which will be
returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeyserialNumberNo optional parameters.
If the historical response was found, RANDOM.ORG returns a JSON-RPC response with the result
property containing the same values that were returned by the
method that was used to generate the values. They are not listed
here, since they depend on the method that was used to generate
the random values. This is illustrated by example below.
Note that all values within the result object
are historical, including not only signature,
but also bitsUsed, bitsLeft,
requestsLeft and advisoryDelay.
For this reason, the client when invoking getResult
should not adapt its behavior in response to these properties,
as it normally should when generating random values using
the Signed API.
For a successful response, the error property is
absent.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests the result generated in Example 1 from
the generateSignedIntegers method description.
{
"jsonrpc": "2.0",
"method": "getResult",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"serialNumber": 6241
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"min": 1,
"max": 6,
"replacement": true,
"base": 10,
"data": [
2, 5, 4
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 14:29:38Z",
"serialNumber": 6241
},
"signature": "Nxdv64PXf6GUe+bCLctc+iAo48MszJqBnuyRP7YWfefXLOxYBfBugG4mUw/06A4GPo9k7sim4dmhnjFG13kPslbn2fIpUMFCy+ZNgZWriaVaq0gevQei2ikeT34ed2IpLdzqe3uCgPXP64OMsx0cdzZIH5lJOPeMDpzYA7wTvve+MXP3z2YP5mWF5EafVM+ma/mlU2w1bQrVvO/38SJZx/m4OAy05PMW9DHyW68+eQtoDfQo6SerIP+Gbb0A9XaFS2tuGMPqmX/DEse07i6ReNUdEHssdWrZvvX++wmzbERA4bbC2n5R4dc5qLsxYYjWZQx5DM/zzhnZ1MLXdvSCukhtJA6Vp6gFLy3WxkbQ+ciy0IaxagCV1D1hAOk26zc8xVwk/VASzp9yb1AZJafj24axbbzTHQX41aEpaRvHhnq6/7RGgVAb9gVoa5QFk/yCIw5oBfhT5ATe4yqRdx5vRduAsCpISA/cp79aZp2P6sss0yVUWJmE7oGG+3uGqSIog2QVBWyLu935jFEnj+lqilyUI5xXN8S5F+V6pZI/lw5wf8IlwXi5nxBKWyat3zrdWjbV7tumilQwBOIr9yh3gSBzrT1c85n0DEAmMQLZSi92ah2OvtMrDH+58P2ME0KeDLB0VMq46k/gl9L4f9ccLBcPOmjmqG/lzLYmgqMvDB8=",
"bitsUsed": 8,
"bitsLeft": 249796,
"requestsLeft": 996,
"advisoryDelay": 2760
},
"id": 2839
}
The result object contains all the properties
that were returned when the random values were generated.
Note that the id property contains the new
JSON-RPC identifier (from the invocation of getResult)
rather than the historical one (from the invocation of
generateSignedIntegers).
The following requests a result generated with a nonexistent API key.
{
"jsonrpc": "2.0",
"method": "getResult",
"params": {
"apiKey": "ffffffff-ffff-ffff-ffff-ffffffffffff",
"serialNumber": 2647656
},
"id": 13609
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 303,
"message": "The resource identified by 'apiKey' was not found",
"data": ["apiKey"]
},
"id": 13609
}
The following requests a result generated with an API key that exists, but where the requested result is nonexistent, for example because it has expired.
{
"jsonrpc": "2.0",
"method": "getResult",
"params": {
"apiKey": "00000000-0000-0000-0000-000000000000",
"serialNumber": 1
},
"id": 28447
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 303,
"message": "The resource identified by 'serialNumber' was not found",
"data": ["serialNumber"]
},
"id": 28447
}
createTickets (method)
This method creates a number of tickets. The tickets can be
used in one of the methods that generate random values.
Your client must set the method property of its
JSON-RPC request object to createTickets. The
request must also contain an id member, which
will be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeynshowResultgetTicket will return. If showResult
is false, getTicket will return only
the basic ticket information. If showResult is
true, the full random and
signature objects from the response that was used
to satisfy the ticket are returned. For more information, please
see the documentation for getTicket.
No optional parameters.
If the request completed successfully, the response contains an array of ticket objects, each of which has the following properties:
ticketIdcreationTimenextTicketIdnextTicketId
will be null.
For a successful response, the error property is
absent.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests two tickets for a particular API key.
{
"jsonrpc": "2.0",
"method": "createTickets",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2,
"showResult": false
},
"id": 26821
}
By setting showResult to false in
the request, the caller specifies that if getTicket
is later invoked for one of the tickets created, then only the
basic details of the ticket will be returned; not the random
values that the ticket was used for. For more information, please
see the documentation for the getTicket method.
The service responds with the following:
{
"jsonrpc": "2.0",
"result": [
{
"ticketId": "b09671d3a527cb5d",
"creationTime": "2021-03-25 14:36:18Z",
"previousTicketId": null,
"nextTicketId": null
},
{
"ticketId": "510969656589b1ac",
"creationTime": "2021-03-25 14:36:18Z",
"previousTicketId": null,
"nextTicketId": null
}
],
"id": 26821
}
The following requests two tickets for a particular API key.
{
"jsonrpc": "2.0",
"method": "createTickets",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"n": 2,
"showResult": true
},
"id": 26821
}
By setting showResult to true in
the request, the caller specifies that if getTicket
is later invoked for one of the tickets created, then the full
details of the ticket will be returned, including the random values
produced when the ticket was used. For more information, please
see the documentation for the getTicket method.
The service responds with the following:
{
"jsonrpc": "2.0",
"result": [
{
"ticketId": "57bc9dead64863bf",
"creationTime": "2021-03-25 14:40:09Z",
"previousTicketId": null,
"nextTicketId": null
},
{
"ticketId": "6c5710afda906835",
"creationTime": "2021-03-25 14:40:09Z",
"previousTicketId": null,
"nextTicketId": null
}
],
"id": 26821
}
listTickets (method)
This method obtains information about tickets that exist for
a given API key. Your client must set the method
property of its JSON-RPC request object to listTickets.
The request must also contain an id member, which
will be returned in the response.
The maximum number of tickets that can be returned by this method is 2000.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
apiKeyticketTypesingleton,
head and tail.
singleton will cause
listTickets to return tickets that have no
previous or next tickets, i.e., tickets that are their only
ones in their chains.
head will cause listTickets
to return tickets that do not have a previous ticket but that
do have a next ticket, i.e., tickets that are the heads in a
chain.
tail will cause listTickets
to return tickets that have a previous ticket but do not have a
next ticket, i.e., tickets that are the tails in a chain.
No optional parameters.
If the request completed successfully, the response contains an array of objects with the following properties:
ticketIdapiKey
specified in the request.
hashedApiKeyshowResultgetTicket will return for the ticket.
If showResult is false,
getTicket will return only the basic ticket
information. If showResult is true,
the full random and signature objects
from the response that was used to satisfy the ticket is returned.
For more information, please see the documentation for
getTicket.
creationTimeusedTimenull.
serialNumberserialNumber returned to obtain the full result
via the getResult method. If the ticket has not
been used yet, this value is null.
expirationTimenull.
previousTicketIdpreviousTicketId is null.
nextTicketIdnextTicketId is null.
For a successful response, the error property is
absent.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following obtains the details of some of the tickets
created in Examples 1 and 2 of the description of the
createTickets method:
{
"jsonrpc": "2.0",
"method": "listTickets",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"ticketType": "singleton"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": [
...,
{
"ticketId": "510969656589b1ac",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": false,
"creationTime": "2021-03-25 14:36:18Z",
"usedTime": null,
"serialNumber": null,
"expirationTime": "2021-04-24 14:36:18Z",
"previousTicketId": null,
"nextTicketId": null
},
...,
{
"ticketId": "6c5710afda906835",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": true,
"creationTime": "2021-03-25 14:40:09Z",
"usedTime": null,
"serialNumber": null,
"expirationTime": "2021-04-24 14:40:09Z",
"previousTicketId": null,
"nextTicketId": null
},
...
],
"id": 2839
}
The response gives the details of all singleton tickets currently
belonging to this API key. To save space, only singleton tickets
which were created in the examples for the createTickets
method are shown.
The following obtains the details of some of the tickets created
in Examples 1 and 2 of the description of the createTickets
method:
{
"jsonrpc": "2.0",
"method": "listTickets",
"params": {
"apiKey": "3fcffb4b-62ca-4a5b-b25e-05e27d909182",
"ticketType": "head"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": [
...,
{
"ticketId": "b09671d3a527cb5d",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": false,
"creationTime": "2021-03-25 14:36:18Z",
"usedTime": "2021-03-25 14:41:40Z",
"serialNumber": 6243,
"expirationTime": "2021-04-24 14:36:18Z",
"previousTicketId": null,
"nextTicketId": "adfdf17ec2f9e9a8"
},
...,
{
"ticketId": "57bc9dead64863bf",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": true,
"creationTime": "2021-03-25 14:40:09Z",
"usedTime": "2021-03-25 14:45:13Z",
"serialNumber": 6244,
"expirationTime": "2021-04-24 14:40:09Z",
"previousTicketId": null,
"nextTicketId": "7b106f57d9f60c8a"
},
...
],
"id": 2839
}
To save space, only the two tickets which were used in Examples
3 and 4 of the generateSignedIntegers method are
shown here. Each ticket returned by this method is the head of a
chain.
getTicket (method)
This method obtains information about a single ticket. Your
client must set the method property of its JSON-RPC
request object to getTicket. The request must also
contain an id member, which will be returned in the
response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
ticketIdcreateTickets method.
No optional parameters.
If the request completed successfully, the response contains an object with the following properties:
ticketIdticketId specified
in the request.
hashedApiKeyshowResultgetTicket will return for the ticket. If
showResult is false, getTicket
will return only the basic ticket information. If
showResult is true, the full
random and signature objects from
the response that was used to satisfy the ticket is returned.
For more information, please see the documentation for
getTicket.
creationTimeusedTimenull.
serialNumberserialNumber returned to obtain the full result
via the getResult method. If the ticket has not
been used yet, this value is null.
expirationTimenull.
previousTicketIdpreviousTicketId is null.
nextTicketIdnextTicketId is null.
For a successful response, the error property is
absent. If the caller has access to the unhashed API key, it
can use the serialNumber from the response to obtain
full details of the response through the use of the
getResult method.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following obtains the details of the first of the tickets
created in Example 1 of the description of the
createTickets method:
{
"jsonrpc": "2.0",
"method": "getTicket",
"params": {
"ticketId": "b09671d3a527cb5d"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"ticketId": "b09671d3a527cb5d",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": false,
"creationTime": "2021-03-25 14:36:18Z",
"usedTime": "2021-03-25 14:41:40Z",
"serialNumber": 6243,
"expirationTime": "2021-04-24 14:36:18Z",
"previousTicketId": null,
"nextTicketId": "adfdf17ec2f9e9a8"
},
"id": 2839
}
The response shows that the ticket exists and when it was
used, which was in Example 3 of the description of the
generateSignedIntegers method. Because the caller
specified false for the showResult
parameter when the ticket was created, the response from
getTicket method only contains the basic ticket
details, not the random values produced when the ticket was
used. If the caller has the unhashed API key corresponding to
hashedApiKey, then they can call getResult
to get the full details of the response.
The following obtains the details of the second of the tickets
created in Example 1 of the description of the
createTickets method:
{
"jsonrpc": "2.0",
"method": "getTicket",
"params": {
"ticketId": "510969656589b1ac"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"ticketId": "510969656589b1ac",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": false,
"creationTime": "2021-03-25 14:36:18Z",
"usedTime": null,
"serialNumber": null,
"expirationTime": "2021-04-24 14:36:18Z",
"previousTicketId": null,
"nextTicketId": null
},
"id": 2839
}
The response shows that the ticket exists but that it has not been used yet.
The following obtains the details of the first of the tickets
created in Example 2 of the description of the
createTickets method:
{
"jsonrpc": "2.0",
"method": "getTicket",
"params": {
"ticketId": "57bc9dead64863bf"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"ticketId": "57bc9dead64863bf",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": true,
"creationTime": "2021-03-25 14:40:09Z",
"usedTime": "2021-03-25 14:45:13Z",
"serialNumber": 6244,
"expirationTime": "2021-04-24 14:40:09Z",
"previousTicketId": null,
"nextTicketId": "7b106f57d9f60c8a",
"result": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 1,
"min": 0,
"max": 36,
"replacement": true,
"base": 10,
"data": [
10
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": {
"ticketId": "57bc9dead64863bf",
"previousTicketId": null,
"nextTicketId": "7b106f57d9f60c8a"
},
"completionTime": "2021-03-25 14:45:13Z",
"serialNumber": 6244
},
"signature": "5K+t7YRREMhpwtcTEHuIfBjCGXLG0Ocrsko5koTnHgeZ9h95jm0DplGg/P+HVkuuJFlSfiNHanrUgJ/uhO7zLXyPvuD/iEqme61nR+fe79CMl4dyNSXswZk/ax6PkOgIMGTR/C9UQPou6VdH8OraP0BBAtpJtSikj6yhIuStnC/2oydzmYVO6n9+kF/M9Zg1ikcXxwCH0MP6e8MgX00mOL7fXvLKjh5ZkxDvWz8gH/Nl96aFhSIsLva2N8b8Mj04y6JTrUKVIGEHrc06BVw1jd5QOq8sHYS5xjGDGpwLRp91SEYXVmJo5qV8uYWN9cxTbtcSBi4JfIUffB5DFjrPs0XhhC0/RYH1U3YE2Y/Z9lzwnCq6kKKU0lQVWyFUeQlVeVVvgfnJZrNvPbubb7+ZNewxn6Wx2uAprI8GQJK/qJid0uzoBB/pncp/36Dn3n/MwokJfkLa5i2mz5opWyhf+GxGoGfibSPT4zBnnBGICOaJ/KJFXSX3Y1CHoNddZSpHLaQTK2WUknNGLEIRS6hvATF73tUtgnXZ2+4CvYuHk5vYjRHdl3BTWjNuL1GU2Bcl8NCi76rBUkSpfpnsJ+0y0a1jelXfMCREPbN8/UKUOHZTafiX3+iOqYB681DEUybfCFRn53h438Hp9vDwc1qqfg34CkUkZspw0z7CASSYMXM=",
"bitsUsed": 5,
"bitsLeft": 249490,
"requestsLeft": 993,
"advisoryDelay": 2720
}
},
"id": 2839
}
The response shows that the ticket exists and when it was
used, which was in Example 4 of the description of the
generateSignedIntegers method. Because the
caller specified true for the showResult
parameter when the ticket was created, the response from
getTicket contains the entire result from the
method that was used to generate the random values.
The following obtains the details of the second of the tickets
created in Example 2 of the description of the
createTickets method:
{
"jsonrpc": "2.0",
"method": "getTicket",
"params": {
"ticketId": "6c5710afda906835"
},
"id": 2839
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"ticketId": "6c5710afda906835",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"showResult": true,
"creationTime": "2021-03-25 14:40:09Z",
"usedTime": null,
"serialNumber": null,
"expirationTime": "2021-04-24 14:40:09Z",
"previousTicketId": null,
"nextTicketId": null,
"result": null
},
"id": 2839
}
The response shows that the ticket exists but that it has
not been used yet. Because showResult was set to
true when createTickets was used to
create the ticket, the response from getTicket
includes a result property. However, it is
null because the ticket has not been used yet.
The following attempts to obtain the details of a ticket that does not exist:
{
"jsonrpc": "2.0",
"method": "getTicket",
"params": {
"ticketId": "7777777777777777"
},
"id": 13354
}
The service responds with the following:
{
"jsonrpc": "2.0",
"error": {
"code": 420,
"message": "The ticket you specified does not exist",
"data": null
},
"id": 13354
}
verifySignature (method)
This method verifies the signature of a response previously
received from one of the methods in the Signed API. This is used
to examine the authenticity of numbers. Your client must set the
method property of its JSON-RPC request object to
verifySignature. The request must also contain an
id member, which will be returned in the response.
The following parameters are mandatory and should be specified
in the params array of the JSON-RPC request:
randomrandom field from a response returned by
RANDOM.ORG through one of the Signed API
methods.
signaturesignature field from the same response that
the random field originates from.
No optional parameters.
If the signature was examined successfully, RANDOM.ORG returns a JSON-RPC response with the result property
containing an object with the following named values:
authenticitytrue if the random
numbers were authentic RANDOM.ORG numbers
or false if they were not.
For a successful response, the error property is
absent.
If an error occurred, RANDOM.ORG returns a
JSON-RPC response in which the result property is
absent and the error property contains an error
object as described in Error Codes and
Messages.
The following requests validation of the response from Example 1
from the generateSignedIntegers method description
above.
{
"jsonrpc": "2.0",
"method": "verifySignature",
"params": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"min": 1,
"max": 6,
"replacement": true,
"base": 10,
"data": [
2, 5, 4
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 14:29:38Z",
"serialNumber": 6241
},
"signature": "Nxdv64PXf6GUe+bCLctc+iAo48MszJqBnuyRP7YWfefXLOxYBfBugG4mUw/06A4GPo9k7sim4dmhnjFG13kPslbn2fIpUMFCy+ZNgZWriaVaq0gevQei2ikeT34ed2IpLdzqe3uCgPXP64OMsx0cdzZIH5lJOPeMDpzYA7wTvve+MXP3z2YP5mWF5EafVM+ma/mlU2w1bQrVvO/38SJZx/m4OAy05PMW9DHyW68+eQtoDfQo6SerIP+Gbb0A9XaFS2tuGMPqmX/DEse07i6ReNUdEHssdWrZvvX++wmzbERA4bbC2n5R4dc5qLsxYYjWZQx5DM/zzhnZ1MLXdvSCukhtJA6Vp6gFLy3WxkbQ+ciy0IaxagCV1D1hAOk26zc8xVwk/VASzp9yb1AZJafj24axbbzTHQX41aEpaRvHhnq6/7RGgVAb9gVoa5QFk/yCIw5oBfhT5ATe4yqRdx5vRduAsCpISA/cp79aZp2P6sss0yVUWJmE7oGG+3uGqSIog2QVBWyLu935jFEnj+lqilyUI5xXN8S5F+V6pZI/lw5wf8IlwXi5nxBKWyat3zrdWjbV7tumilQwBOIr9yh3gSBzrT1c85n0DEAmMQLZSi92ah2OvtMrDH+58P2ME0KeDLB0VMq46k/gl9L4f9ccLBcPOmjmqG/lzLYmgqMvDB8="
},
"id": 25691
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"authenticity": true
},
"id": 25691
}
The value of true for the authenticity
field indicates that the random value specified as
part of the request was indeed signed by RANDOM.ORG,
proving the authenticity of the numbers.
The following requests validation of the response from Example 1
above except that the first integer has been modified from 2 to 6,
as you might expect in a tampering attempt. The other values in
the random field have not been modified.
{
"jsonrpc": "2.0",
"method": "verifySignature",
"params": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 3,
"min": 1,
"max": 6,
"replacement": true,
"base": 10,
"data": [
6, 5, 4
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": null,
"ticketData": null,
"completionTime": "2021-03-25 14:29:38Z",
"serialNumber": 6241
},
"signature": "Nxdv64PXf6GUe+bCLctc+iAo48MszJqBnuyRP7YWfefXLOxYBfBugG4mUw/06A4GPo9k7sim4dmhnjFG13kPslbn2fIpUMFCy+ZNgZWriaVaq0gevQei2ikeT34ed2IpLdzqe3uCgPXP64OMsx0cdzZIH5lJOPeMDpzYA7wTvve+MXP3z2YP5mWF5EafVM+ma/mlU2w1bQrVvO/38SJZx/m4OAy05PMW9DHyW68+eQtoDfQo6SerIP+Gbb0A9XaFS2tuGMPqmX/DEse07i6ReNUdEHssdWrZvvX++wmzbERA4bbC2n5R4dc5qLsxYYjWZQx5DM/zzhnZ1MLXdvSCukhtJA6Vp6gFLy3WxkbQ+ciy0IaxagCV1D1hAOk26zc8xVwk/VASzp9yb1AZJafj24axbbzTHQX41aEpaRvHhnq6/7RGgVAb9gVoa5QFk/yCIw5oBfhT5ATe4yqRdx5vRduAsCpISA/cp79aZp2P6sss0yVUWJmE7oGG+3uGqSIog2QVBWyLu935jFEnj+lqilyUI5xXN8S5F+V6pZI/lw5wf8IlwXi5nxBKWyat3zrdWjbV7tumilQwBOIr9yh3gSBzrT1c85n0DEAmMQLZSi92ah2OvtMrDH+58P2ME0KeDLB0VMq46k/gl9L4f9ccLBcPOmjmqG/lzLYmgqMvDB8="
},
"id": 25691
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"authenticity": false
},
"id": 25691
}
The value of false for the authenticity
field indicates that the random value specified as
part of the request was not signed by RANDOM.ORG,
i.e., the signature is not valid.
The following requests validation of the response from Example
2 in the section about generateSignedIntegers,
except that the MD5 digest that was specified in the original
request has been replaced with another, as might be the case
if an attempt at tampering had been made.
{
"jsonrpc": "2.0",
"method": "verifySignature",
"params": {
"random": {
"method": "generateSignedIntegers",
"hashedApiKey": "ncGk4bCmDT7GSc64MzGzNvRUoDT++pTPjntmtuu075JFqKbz/G4nKerq0JQoldvtQxYOCePxMN5gcYZSOC2DTg==",
"n": 52,
"min": 1,
"max": 52,
"replacement": false,
"base": 10,
"data": [
32, 18, 49, 22, 5, 41, 26, 10, 24, 40, 46, 1, 20, 6, 37, 30, 2, 42, 31, 38, 47, 25, 11, 19, 7, 16, 48, 3, 14, 15, 9, 51, 39, 23, 21, 12, 27, 4, 33, 17, 44, 45, 8, 35, 36, 34, 52, 29, 50, 43, 13, 28
],
"license": {
"type": "developer",
"text": "Random values licensed strictly for development and testing only",
"infoUrl": null
},
"userData": {
"myHashType": "md5",
"myHashValue": "a7d8eb2cb9c55110a91e2a80b7932177"
},
"ticketData": null,
"completionTime": "2021-03-25 14:31:55Z",
"serialNumber": 6242
},
"signature": "7OAGAZcY4OkHJUD84vmFQXDSFykd9Td55AHubBHbQzGuJ5+sPSPj5HzZK0qMzxI8L+BuQbz1ayIYxlKP3heni125XFe6tB5L24qNgA1r5cAZVaXkU2BTsockio0s4YYDdIVz8chLA6cYqu03AjzuI8Q7G2QSLbdOdQYKz27nvJsFgf9ER5MawgMH4E4VTSGG6roVJMN0ANiHndoRPMaIzKgve4oPnZDoG5Tj/hK+gGohSamrf1XnpG3muM/ZsOsUxVPmh4TaJ/tjSvilkEoUphMsYzXvq/qiVBXUoOLKC0aks/oURveQnfFQjSLj9Bc4lj99UZzJWHN8Aotaz2MysUDuf65axyEu8ulJOJkypB47T7mT00jk+STQ1aYI6JwS9NsQ7qPXaJtDJRMhUXdj3VFM7xe8HMtTTEoWq08bb22qKDJLhOLrl3NO4A+ALLsJjdjhpJvR09ezaUC9JJCG18ChNM+8wLvyvpF7jQxl5V24/nrSLHqeS3m64r9Ip5BG8F/UADwRUdiFhbewGJZTjWfOBWq55WcQRQzYQacOQo5R1Pub5bBWiobdkLeMdLdCey8MjptGymYdJGBWIEBpuF/97Y494GYJdtqOhT75GRR+/mxj7pnd9ghl3i0E3825uZO3fqoCpKAp2vASzo/GG6sfc5OhErex9uEVWbnMz6M="
},
"id": 25691
}
The service responds with the following:
{
"jsonrpc": "2.0",
"result": {
"authenticity": false
},
"id": 25691
}
The value of false for the authenticity
field indicates that the userData value specified
as part of the request was not signed by RANDOM.ORG,
i.e., the signature is not valid.