# Office Code Lookup

This endpoint allows you to retrieve office codes for operators such as Nepal Water, NEA&#x20;

## Office Code Listing API

<mark style="color:green;">`POST`</mark> `/utility/office-codes`

**Headers**

| Name         | Value              |
| ------------ | ------------------ |
| Content-Type | `application/json` |
| Accept       | `application/json` |
| x-auth-token | `<token>`          |

**Body**

| Name          | Type   | Description                 |
| ------------- | ------ | --------------------------- |
| `operator_id` | string | ID of the relevant operator |

**Response**

{% tabs %}
{% tab title="200" %}

```json
{
    "error": false,
    "message": "Success Message",
    "data": [
        {
            "value": 1,
            "label": "Name of office code"
        }
    ]
}
```

{% endtab %}

{% tab title="4XX/5XX" %}

```json
{
    "error": true,
    "message": "Description for the error",
}
```

{% endtab %}

{% tab title="Guzzle" %}

```php
use GuzzleHttp\Client;

$url    = 'utility/office-codes';

$form_params =
  [
    'operator_id'      => '44' //nea
  ];
            
$client = new Client([
    'base_uri' => 'https://uatservices.globaltopup.in/api/v1/',
          ]);
          $res = $client->post($url, [
          'json' => $form_params, // Send JSON payload
          'headers' => 
        [
             'x-auth-token' => 'Token Provided by Global Topup',
             'Content-Type' => 'application/json'
        ]
                ]);
              
   $response       =   json_decode($res->getBody()->getContents(), true);

```

{% endtab %}

{% tab title="PHP" %}

```php
$curl = curl_init();

$data = json_encode(array(
    'operator_id' => '44'
));

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://uatservices.globaltopup.in/api/v1/utility/office-codes',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $data, // Send JSON payload
  CURLOPT_HTTPHEADER => array(
    'x-auth-token: Token Provided by Global Topup',
    'Accept: application/json',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

```

{% endtab %}

{% tab title="Curl" %}

```php

curl -X POST https://uatservices.globaltopup.in/api/v1/utility/office-codes
     -H 'Content-Type: application/json'
     -H 'Accept: application/json' 
     -H 'x-auth-token: Global Topup Provided Token'
     -d '{"operator_id" : "44"}' // Send JSON payload
```

{% endtab %}
{% endtabs %}

The response contains an error flag and a message, along with an array of object with office code data in case of success response, where each office code has a numerical/string value and a label.


---

# Agent Instructions: 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:

```
GET https://docs.globaltopup.in/additional-nepal-apis/office-code-lookup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
