Library

Browse and search developer information

A003: Delete Professional Session

API

DELETE /v1/ProfessionalSession/{sessionKey}

Description

Logs out of the Professional Session and closes the dialogue.

Input

The Session ID / Key of the session to be deleted should be provided as the sessionKey path parameter. The Session ID is that returned in ProfessionalSession.id.

Example

DELETE http://<baseUrl>/v1/ProfessionalSession/pro-xapi-session_0537f534-5c9a-4240-a401-90c9b7770139

Output

If successful the response code 204 (No Content) is returned. This response has no body.

Code Sample

Code snippets taken from the consumer example. See Code Samples for further details.

        function deleteSession() {
            var deferred = $q.defer();
            
            var headersJson = {};
            headersJson[config.asidHeader] = config.asid;
            headersJson[config.sessionIdHeader] = scope.sessionData.id;
            
            var rest = $resource(
                    config.baseUrl + '/v1/ProfessionalSession/' + scope.currentSessionId, 
                    null,
                    {'delete': {method: 'DELETE', headers: headersJson}}
            );
            rest.delete(function() {
                deferred.resolve(true);
                scope.currentSessionId = null;
            }, function() {
                deferred.reject();        
            });
            
            return deferred.promise;
        }

Notes

Consuming application must have a valid session in order to access this endpoint.

Used to delete a Professional Session after it has been created.

Once deleted the associate Session ID will become invalid.

Session is initially created using the Create Session / Select Role endpoints.