Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 10 Next »

account_decrypt_shared_key (shared_key, language )

Decrypts a shared key and returns information about the channel by which it was sent

Input

parameters:

  • shared_key: an encrypted string that contains information about the communication channel used to create the account (email, phone...). This shared_key can be obtained from:
    • account_create(): returns the shared key after creating a new account that needs to be activated, and also after trying to create an account that already exists but needs to be activated.
    • session_init(): returns the shared key if the account exists but needs to be activated
    • An invitation sent by a other user in the system. In this scenario the shared key is sent by email/sms embedded in an URL that redirects to LC2 interface (to the "activate account" page)
  • language: language code ('EN', 'ES', ...). If no language is provided, 'EN' will be used as default. This language will be used for the error description (if any)

Output

parameters:

  • result: an XML with information contained in the shared key. Depending on the type of shared key, the information will be different. Find below examples of the different shared keys and responses
  • ErrorMsg: In case of error, the description of the error in the language provided in the lang parameter
  • ErrorCode: In case of error, one of the possible ERROR CODES

Request

sample:

account_decrypt_shared_key ( “78csahi7chqw7r”, "ES");

Response

sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<result>
    <sharedkey>
        <type>1</type>
        <locale>es<locale>
        <channel>mymail@company.com</channel>
        <channeltype>EMAIL</channeltype>
    </sharedkey>
</result>
<ErrorMsg></ErrorMsg>
<ErrorCode></ErrorCode>

Notes:


Return Error codes

ERROR CODE

SHAREDKEY.INVALID

The shared key indicated is not valid

ACCOUNT.ACTIVATION_PENDING

Returned when the shared key is an ASSOCIATE INVITATION and the account is pending to be activated (using account_activate() )

ACCOUNT.ALREADY_ACTIVE

Returned when the shared key is an ACCOUNT VERIFICATION and the account is already active

PROGRAM.NOT_FOUND

Returned when the shared key is a PROGRAM INVITATION but the information contained in the shared key does not correspond to an existing PROGRAM

Types of Shared Keys

Type

Description
Example of XML returned
1

ASSOCIATE_INVITATION

Generated when a CASE sends an invitation to an ASSOCIATE using the function case_insert_associate()
<sharedkey>
    <type>3</type>
    <locale>es<locale>
    <channel>mymail@company.com</channel>
    <channeltype>EMAIL</channeltype>
</sharedkey>
2

PROGRAM_INVITATION

An invitation to a PROGRAM. This type of invitation allows a new User to create a SUBSCRIPTION to a PROGRAM.

Generated by program_get_invitation() 

<sharedkey>
    <lang>es</lang>
    <type>2</type>
    <name>Detección de los genes BRCA</name>
    <description>BRCA de detección desarrollado para PRECEDI</description>
</sharedkey>
3

ACCOUNT_VERIFICATION

Generated when a new USER is registered in Linkcare WS and need to be activated. This shared key can be generated by

<sharedkey>
    <type>3</type>
    <locale>es<locale>
    <channel>mymail@company.com</channel>
    <channeltype>EMAIL</channeltype>
</sharedkey>
  • No labels