Server-Side Cloud Script - Post Function Result For Entity Triggered Action

Generate an entity PlayStream event for the provided function result.

POST https://titleId.playfabapi.com/CloudScript/PostFunctionResultForEntityTriggeredAction

Request Header

Name Required Type Description
X-EntityToken True

string

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Request Body

Name Required Type Description
Entity True

EntityKey

The entity to perform this action on.

FunctionResult True

ExecuteFunctionResult

The result of the function execution.

CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Responses

Name Type Description
200 OK

EmptyResult

400 Bad Request

ApiErrorWrapper

This is the outer wrapper for all responses with errors

Security

X-EntityToken

This API requires an Entity Session Token, available from the Entity GetEntityToken method.

Type: apiKey
In: header

Definitions

Name Description
ApiErrorWrapper

The basic wrapper around every failed API response

EmptyResult
EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

ExecuteFunctionResult
FunctionExecutionError
PostFunctionResultForEntityTriggeredActionRequest

ApiErrorWrapper

The basic wrapper around every failed API response

Name Type Description
code

integer

Numerical HTTP code

error

string

Playfab error code

errorCode

integer

Numerical PlayFab error code

errorDetails

object

Detailed description of individual issues with the request object

errorMessage

string

Description for the PlayFab errorCode

status

string

String HTTP code

EmptyResult

EntityKey

Combined entity type and ID structure which uniquely identifies a single entity.

Name Type Description
Id

string

Unique ID of the entity.

Type

string

Entity type. See https://docs.microsoft.com/gaming/playfab/features/data/entities/available-built-in-entity-types

ExecuteFunctionResult

Name Type Description
Error

FunctionExecutionError

Error from the CloudScript Azure Function.

ExecutionTimeMilliseconds

number

The amount of time the function took to execute

FunctionName

string

The name of the function that executed

FunctionResult

object

The object returned from the function, if any

FunctionResultTooLarge

boolean

Flag indicating if the FunctionResult was too large and was subsequently dropped from this event.

FunctionExecutionError

Name Type Description
Error

string

Error code, such as CloudScriptAzureFunctionsExecutionTimeLimitExceeded, CloudScriptAzureFunctionsArgumentSizeExceeded, CloudScriptAzureFunctionsReturnSizeExceeded or CloudScriptAzureFunctionsHTTPRequestError

Message

string

Details about the error

StackTrace

string

Point during the execution of the function at which the error occurred, if any

PostFunctionResultForEntityTriggeredActionRequest

Name Type Description
CustomTags

object

The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.).

Entity

EntityKey

The entity to perform this action on.

FunctionResult

ExecuteFunctionResult

The result of the function execution.