*GET* /access ~~~~~~~~~~~~~ .. note:: LaterPay does not store access information for :doc:`Contributions ` or :doc:`Donations `. Answers the question "Does the user have access to this item?" Example URLs: * https://api.laterpay.net/access (EU Production) * https://api.sandbox.laterpaytest.net/access (EU :ref:`Sandbox `) * https://api.uselaterpay.com/access (US Production) * https://api.sandbox.uselaterpaytest.com/access (US :ref:`Sandbox `) Parameters ---------- ``article_id`` (required) Some unique identifier for the current article. Article ids have no significance/meaning to LaterPay, their format and structure is up to you, and they do not require any form of "pre-registration". Must be a UTF-8 string (except ☃ [Unicode Snowman]). This parameter may be included multiple times, to check access for multiple articles simultaneously. ``lptoken`` (one of ``lptoken`` or ``muid`` is required) :doc:`A token <../identification/user_tokens>` identifying the device or LaterPay user on your site. ``muid`` (one of ``muid`` or ``lptoken`` is required) A :doc:`Merchant Provided User ID <../identification/muids>` ``cp, hmac, ts`` (required) :ref:`common_parameters` .. note:: One of ``lptoken`` or ``muid`` parameters is required and both cannot be used in one URL. Response -------- **/access** returns a JSON object with the following keys: ``status`` ``'ok'`` if the request was handled correctly, or ``'error'`` if some problem occurred (such as an incorrect set of parameters). ``message`` If there was a problem, there may be an *optional* ``'message'`` value explaining the problem. ``articles`` A JSON object where the keys are the ``article_id``\ s supplied in the request, and the values are JSON objects containing access data about the article. ``new_token`` An *optional* return value that contains a new token value to use in the future instead of the token you already have. This can happen for example when you have a token that represents a device, but the user has since logged into their LaterPay account. You should replace the user's current token with this new token. Objects in ``articles`` have the following keys: ``access`` A boolean indicating whether or not the user should have access to the article ``expiry`` (*optional*) An integer amount of seconds since the Unix epoch (00:00:00 1st Jan 1970) expressing when a user's access to an item expires or expired. Example responses: :: { "status" : "ok", "articles" : {"12345": {"access": true}} } { "status" : "ok", "articles" : {"12345": {"access": true}}, "new_token" : "t|1234567899..." } { "status" : "ok", "articles" : {"12345": {"access": true}, "54321": {"access": true, "expiry": 1421139537}} } { "status" : "invalid_token" }