Server-Side Cloud Script - Post Function Result For Function Execution
Generate an entity PlayStream event for the provided function result.
Allowed entity token types: title
POST https://titleId.playfabapi.com/CloudScript/PostFunctionResultForFunctionExecution
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 |
The entity to perform this action on. |
|
| FunctionResult | True |
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 | ||
| 400 Bad Request |
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 |
|---|---|
|
Api |
The basic wrapper around every failed API response |
|
Empty |
|
|
Entity |
Combined entity type and ID structure which uniquely identifies a single entity. |
|
Execute |
|
|
Function |
|
|
Post |
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 |
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 |
| FunctionResultSize |
number |
The size in bytes of 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 |
PostFunctionResultForFunctionExecutionRequest
| Name | Type | Description |
|---|---|---|
| CustomTags |
object |
The optional custom tags associated with the request (e.g. build number, external trace identifiers, etc.). |
| Entity |
The entity to perform this action on. |
|
| FunctionResult |
The result of the function execution. |