Invoke Endpoints

Location /api/apps/{appID}/server-code/versions/current/{ENDPOINT_NAME}
The endpoint name of your server code to be execute.

Request Headers (Applies to all methods)

Authorization
header
Required: Yes

POST

/api/apps/{appID}/server-code/versions/current/{ENDPOINT_NAME}

Description

Invoke the endpoint of the server code.

Security

Can be execute with any type of credentials (admin, user or anonymous)

Content-Type application/json

Arguments to be passed to the endpoint function. Please set the argument as a JSON Object.

Headers
Name Required? type Description
Authorization Yes string Authorization can be of type Basic or Bearer.
  • Authorization Basic: header for granting an anonymous access.
    • Set a Base64-encoded string of AppID and AppKey concatenated with a colon (APP_ID:APP_KEY).
    • The header should look like:
      Authorization: Basic czZCaGRSa3F0Mzo3RmpmcDBaQnIxS3REUmJuZlZkbUl3
  • Authorization Bearer: using Oauth2 Bearer Token.
    • The header should look like:
      Authorization: Bearer ht5fpHQAyrPPwLftK1rAqllv5WNVPCnYfPiCvPocFuQ
Responses
200

Content-Type application/json

The server code was invoked successfully.
400

Content-Type application/vnd.kii.ValidationException+json

The endpoint was invalid.
Contents
Name Type Description
errorCode string Error code "INVALID_INPUT_DATA".
message string The error message.
400

Content-Type application/vnd.kii.EndpointInvocationErrorException+json

Error found while executing the server code
Contents
Name Type Description
errorCode string Error code "ENDPOINT_INVOCATION_ERROR".
message string The error message.
details string The details of the error