> For the complete documentation index, see [llms.txt](https://switchng.gitbook.io/switch/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://switchng.gitbook.io/switch/admin-core-request-logs.md).

# Admin/Core Request Logs

```
STAGING_URL: https://switchapi3.azurewebsites.net
LIVE_URL: https://switchapi.azurewebsites.net
```

## Get list of logs

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/admin/core_request_logs`

This endpoint retrieves the list of core request logs.

#### Query Parameters

| Name      | Type   | Description          |
| --------- | ------ | -------------------- |
| page      | string | Defaults to 1.       |
| per\_page | string | Defaults to 20.      |
| status    | string | Status filter.       |
| query     | string | Query string filter. |

#### Headers

| Name          | Type   | Description                  |
| ------------- | ------ | ---------------------------- |
| SWI-CID       | string | Client ID                    |
| Authorization | string | Format is ***Bearer token*** |

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

```
{
    "message": "Logs retrieved successfully",
    "data": [
        {
            "id": 255,
            "method": "GET",
            "endpoint": "/SwitchBank/Core/FundingRequery",
            "createdAt": "2020-04-27T21:57:26.677Z",
            "updatedAt": "2020-04-27T21:57:26.677Z",
            "status": 200,
            "body": null,
            "query": {
                "processorReferenceID": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "transactionReference": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea"
            },
            "response": {
                "Status": false,
                "ResponseCode": "E01",
                "Message": "Operation Failed",
                "Data": {
                    "ProcessorReference": null,
                    "TransactionFTRefernce": null,
                    "TransactionLogReferenceID": null,
                    "TransactionResponseCode": null,
                    "TransactionFTMessage": null,
                    "Amount": 0,
                    "CurrencyCode": null
                },
                "MandateId": null
            }
        },
        {
            "id": 254,
            "method": "POST",
            "endpoint": "/SwitchBank/Core/FundWallet",
            "createdAt": "2020-04-27T21:57:24.834Z",
            "updatedAt": "2020-04-27T21:57:24.834Z",
            "status": 400,
            "body": {
                "TotalAmount": "100000",
                "Processor": 1,
                "ProcessorReferenceId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "CurrencyCode": "566",
                "Remark": "funding",
                "SessionId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "ReferenceId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "CustomerPhoneNumber": "+2349090491756",
                "TransactionFee": "00",
                "CustomerType": 2,
                "Nuban": "0072137711",
                "AccountName": "IFEDAYO OLUWADAMILOLA BOLUWATIFE"
            },
            "query": {},
            "response": {
                "Status": false,
                "ResponseCode": "99",
                "Message": "Bad Request",
                "Data": [
                    {
                        "Exception": null,
                        "ErrorMessage": "This reference ID 81278813-e791-4c4f-99ca-paystack-44593c59e0ea by Paystack has already been Used"
                    }
                ],
                "MandateId": null
            }
        },
        {
            "id": 253,
            "method": "GET",
            "endpoint": "/SwitchBank/BalanceEnquiry",
            "createdAt": "2020-04-27T21:57:01.701Z",
            "updatedAt": "2020-04-27T21:57:01.701Z",
            "status": 200,
            "body": null,
            "query": {
                "nuban": "0072137711",
                "referenceId": "ife@gmail.com"
            },
            "response": {
                "Status": true,
                "ResponseCode": "00",
                "Message": "Operation Successful",
                "Data": {
                    "AccountNo": "0072137711",
                    "AvailableBalance": 0,
                    "BookedBalance": 0,
                    "AccountName": "Current Account",
                    "ResponseText": null
                },
                "MandateId": null
            }
        },
        {
            "id": 252,
            "method": "GET",
            "endpoint": "/SwitchBank/Core/FundingRequery",
            "createdAt": "2020-04-27T20:06:00.142Z",
            "updatedAt": "2020-04-27T20:06:00.142Z",
            "status": 200,
            "body": null,
            "query": {
                "processorReferenceID": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "transactionReference": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea"
            },
            "response": {
                "Status": false,
                "ResponseCode": "E01",
                "Message": "Operation Failed",
                "Data": {
                    "ProcessorReference": null,
                    "TransactionFTRefernce": null,
                    "TransactionLogReferenceID": null,
                    "TransactionResponseCode": null,
                    "TransactionFTMessage": null,
                    "Amount": 0,
                    "CurrencyCode": null
                },
                "MandateId": null
            }
        },
        {
            "id": 251,
            "method": "POST",
            "endpoint": "/SwitchBank/Core/FundWallet",
            "createdAt": "2020-04-27T20:05:58.915Z",
            "updatedAt": "2020-04-27T20:05:58.915Z",
            "status": 400,
            "body": {
                "TotalAmount": "100000",
                "Processor": 1,
                "ProcessorReferenceId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "CurrencyCode": "566",
                "Remark": "funding",
                "SessionId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "ReferenceId": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
                "CustomerPhoneNumber": "+2349090491756",
                "TransactionFee": "00",
                "CustomerType": 2,
                "Nuban": "0072137711",
                "AccountName": "IFEDAYO OLUWADAMILOLA BOLUWATIFE"
            },
            "query": {},
            "response": {
                "Status": false,
                "ResponseCode": "99",
                "Message": "Bad Request",
                "Data": [
                    {
                        "Exception": null,
                        "ErrorMessage": "This reference ID 81278813-e791-4c4f-99ca-paystack-44593c59e0ea by Paystack has already been Used"
                    }
                ],
                "MandateId": null
            }
        }
    ],
    "meta": {
        "total": 255,
        "per_page": 5,
        "page": 1,
        "page_count": 51
    }
}
```

{% endtab %}
{% endtabs %}

## Get log by Id

<mark style="color:blue;">`GET`</mark> `https://switchapi3.azurewebsites.net/admin/core_request_logs/:id`

This endpoint retrieves a log by id.

#### Path Parameters

| Name | Type   | Description        |
| ---- | ------ | ------------------ |
| id   | string | The id of the log. |

#### Headers

| Name           | Type   | Description                  |
| -------------- | ------ | ---------------------------- |
| SWI-CID        | string | Client ID                    |
| Authentication | string | Format is ***Bearer token*** |

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

```
{
    "message": "Log retrieved successfully",
    "data": {
        "id": 255,
        "method": "GET",
        "endpoint": "/SwitchBank/Core/FundingRequery",
        "createdAt": "2020-04-27T21:57:26.677Z",
        "updatedAt": "2020-04-27T21:57:26.677Z",
        "status": 200,
        "body": null,
        "query": {
            "processorReferenceID": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea",
            "transactionReference": "81278813-e791-4c4f-99ca-paystack-44593c59e0ea"
        },
        "response": {
            "Status": false,
            "ResponseCode": "E01",
            "Message": "Operation Failed",
            "Data": {
                "ProcessorReference": null,
                "TransactionFTRefernce": null,
                "TransactionLogReferenceID": null,
                "TransactionResponseCode": null,
                "TransactionFTMessage": null,
                "Amount": 0,
                "CurrencyCode": null
            },
            "MandateId": null
        }
    }
}
```

{% endtab %}

{% tab title="404 " %}

```
{
    "message": "Log with id 2550 does not exist"
}
```

{% endtab %}
{% endtabs %}
