Id field in API request

Hi !
I’m curious about what’s the use of the “id” field in the API request.
seems i can pass anything, as long as method is correct, the API answers correctly.
Anyone has a clue?


The id is specified in the JSON RPC protocol.

An identifier established by the Client that MUST contain a String, Number, or NULL value if included. If it is not included it is assumed to be a notification. The value SHOULD normally not be Null [1] and Numbers SHOULD NOT contain fractional parts [2]
The Server MUST reply with the same value in the Response object if included. This member is used to correlate the context between the two objects.

[1] The use of Null as a value for the id member in a Request object is discouraged, because this specification uses a value of Null for Responses with an unknown id. Also, because JSON-RPC 1.0 uses an id value of Null for Notifications this could cause confusion in handling.

[2] Fractional parts may be problematic, since many decimal fractions cannot be represented exactly as binary fractions.

You’re not guaranteed to get your answers back in the order you asked for them; the id is to help you sort that out.

Amazing, thanks aplenty for the explanation and the link. I should be ok with random values.