> For the complete documentation index, see [llms.txt](https://docs.arcware.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arcware.cloud/unreal-engine-setup/using-the-arcware-pixel-streaming-template-project/getting-started/arcware-blueprints/arcware-player-controller/sending-and-receiving-json-messages.md).

# Sending and Receiving Json messages

Arcware Player Controller

In the BP\_Arcware\_Player\_Controller blueprint you will see pre-existing blueprint nodes for handling the receiving/sending of Json messages. \
\
The content/wording of the Json messages should be agreed upon between the web frontend developer and Unreal Engine developer, as both sides need to be aware of the possible Json messages it's receiving before anything can be triggered. \
\
A typically workflow example of a Json message being sent to Unreal Engine would be...\
\
1\) User clicks button in frontend\
\
2\) Frontend sends Json message to Unreal Engine application i.e...

```
emitUIInteraction({ Console: r.setres 1000x2000w })
```

3\) Unreal Engine receives this Json message in the Player Controller via the '**Pixel Streaming Input**' component

<figure><img src="https://451842398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxeRHVvCMHTEw8OnxbYIg%2Fuploads%2FSoMcoCV1zmpnKJ86zHsb%2FArcware%20PlayerController-%20PixelStreamerInput%20component.jpg?alt=media&amp;token=30887b79-4832-4b93-bde5-9441c7cfd9ae" alt=""><figcaption></figcaption></figure>

4\)  Json message is received and the **Get Json String Value** node searches the message for the pre-determined **Field Name**... **'Console'**. If this **Field name** is present in the Json message, then the **String Value** will be used to trigger a Console Command. In this example the **String Value** would be **'r.setres 1000x2000w'**

<figure><img src="https://451842398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxeRHVvCMHTEw8OnxbYIg%2Fuploads%2FulR01GrNxOrjvQnIRUtc%2FArcware%20PlayerController-%20Get%20Json%20String%20Value.jpg?alt=media&amp;token=a07e168e-90c9-439d-9ded-fce255832582" alt=""><figcaption></figcaption></figure>

5\) (This step is Optional). After the desired event is triggered, we send a Json message response back to frontend via the **Send Pixel Streaming Response** node. The content of the message response should be discussed with the frontend developer so they know what to intercept, in this example we just send back the same message as received i.e...

```
{ "Console": "r.setres 1000x2000w" }
```

<figure><img src="https://451842398-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxeRHVvCMHTEw8OnxbYIg%2Fuploads%2FwJspERg9GJTkrNELoTSO%2FArcware%20PlayerController-%20Send%20Json%20Reponse.jpg?alt=media&amp;token=fad945bd-71ec-4a8f-8017-c1f4835a3c99" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.arcware.cloud/unreal-engine-setup/using-the-arcware-pixel-streaming-template-project/getting-started/arcware-blueprints/arcware-player-controller/sending-and-receiving-json-messages.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
