Submit a request
Submit a request

Managing API Session Validity With "Expires"

This article outlines the Questions API's expires flag which overrides the validTimestampFrame.
 

In order to give our clients more control over how long a Questions API session is valid for we have added an expires flag to explicitly allow over-riding the validTimestampFrame.

This optional attribute called expires can be set in the request to a GMT date of format YYYYMMDD-HHMM and it can be over-ridden on a per request basis.

This can be set to a longer period or a shorter period than the validTimestampFrame. All requests to save or submit will fail once the expires timestamp has passed. It is possible to pass this flag to the Items API in either inline mode or assess mode.

Key Type Default Description
expires string none GMT date of format YYYYMMDD-HHMM
 

Example

$security = array(
        "consumer_key"    => "INSERT_CONSUMER_KEY_HERE",
        "domain"          => "my.domain.com",
        "timestamp"       => gmdate("Ymd-Hi"),
        "user_id"         => "examUser1",
        "expires"         => "YYYYMMDD-HHMM",
        "consumer_secret" => "INSERT_CONSUMER_SECRET_HERE"
);

Did you arrive here by accident? If so, learn more about Learnosity by clicking here.