shared_key_extend()

shared_key_extend()

Function prototype

shared_key_extend (session, shared_key, data)

API Version

2.7.19 and higher

Appends content to an existing shared_key

A SHARED KEY OBJECT contains information and instructions to perform different actions.

This function allows to append additional information to some types of shared keys to modify its behavior when executed.

Input parameters:

  • session: is the session token obtained in the session_init() call. This parameter is only necessary if the shared key is public (see SHARED KEY OBJECT )

  • shared_key: the shared key object to be modified.

  • data: information that will be appended to the shared key. The format of this data depends on the type of shared key.

Output parameters:

  • result: extended shared key

  • ErrorMsg: If any error occurs, then this value contains a description of the error translated to the current language

  • ErrorCode: If any error occurs, then this value contains any of the standard ERROR CODES

Request sample:

shared_key_extend ( ‘LCAAAAAAAAAAAA’, 'a8ccdse5tI9saX5g54', '{“my_data”:”value”}' );

Response sample:

<?xml version="1.0" encoding="utf-8" standalone="yes"?> <result>50fhq9JKauB97gsaHGHJG78978asghJHsadgTYYasd</result> <ErrorMsg></ErrorMsg> <ErrorCode></ErrorCode>





Notes:



Return Error codes

ERROR CODE



ERROR CODE



INVALID_TOKEN

The session token provided is not valid.

INSUFFICIENT_PRIVILEGES

The session user does not have the necessary privileges to extend the shared key

SHAREDKEY.INVALID

Invalid shared key provided

EXTENSIBLE SHARED KEYS

CREATE_ADMISSION shared key

The "CREATE_ADMISSION" SHARED KEY shared key is used to create a new ADMISSION in a SUBSCRIPTION and contains optional information that will be added to the TASKs in the stage “ADMISSION_SETUP” as explained in admission_create ().

The format of the parameter data must be a JSON string representing a simple object with a list of properties and values.

Example

{ "setup_field": 1, "other_setup_field": "example value" }