> 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
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=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
