> For the complete documentation index, see [llms.txt](https://glyue.docs.sandboxbanking.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://glyue.docs.sandboxbanking.com/tutorials/building-a-retrieval-api-against-fis-codeconnect/4.-integration-and-service-request-hook-setup.md).

# 4. Integration and Service Request Hook Setup

**Integration and Service Request Hooks**\
\
From here, there are only a few more things we need to do in order to query the core system for customer information and return it to the source system.\
\
From the previous step, we set the `_path` field mapping row's value to `f"customers/{customerNumber}"` . Essentially, we've established part of the URL path we will be reaching out to in this service request.\
\
The "{customerNumber}" part of that path is a variable we need to set.\
\
Navigate to the Integration Level of the Build page. Open the **Before Hook** of the integration that you've created. Paste the following lines of code into the cell and save your changes:<br>

```python
customerNumber = "00000000001"
keep(customerNumber = customerNumber)
```

\
The first line sets the customerNumber variable to "00000000001" as an example customer number, but this value can be replaced with a reference to the input payload, such as `input.payload.custNum` as needed.\
\
The second line of code uses the `keep()` function to ensure that this variable is kept in memory and can be used in other parts of the integration, such as the field mapping table where we reference it.\
\
Next, navigate to the service request level of this integration. From here, scroll to the right until you find the column labelled **"After Overall Success Hook"**. Open this column and paste the following line of code into the cell:

```python
output.payload = getCustomer.response.payload
```

\
Essentially, this line of code will take the **response** of the service request to CodeConnect and assign it to the **output** of the Integration Gateway integration. Keep in mind that you will need to replace `getCustomer` with the formula variable you assigned to the service request if you named it differently.


---

# 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://glyue.docs.sandboxbanking.com/tutorials/building-a-retrieval-api-against-fis-codeconnect/4.-integration-and-service-request-hook-setup.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.
