### Example Up Banking API Endpoint URL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This example illustrates how a specific endpoint, /accounts, is appended to the base URL to form a complete callable API endpoint. ```Plain Text https://api.up.com.au/api/v1/accounts ``` -------------------------------- ### Filtering Transactions by Start Date-Time (HTTP) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This example demonstrates how to filter transactions by a start date-time using the `filter[since]` query parameter. The date-time must be formatted according to RFC 3339. This parameter is not intended for pagination purposes. ```HTTP ?filter[since]=2020-01-01T01:02:03+10:00 ``` -------------------------------- ### Partial Up Bank Transaction Resource JSON Example Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON fragment illustrates key components of an Up Bank transaction resource, including attributes like `settledAt`, `createdAt`, `transactionType`, `note`, `performingCustomer`, and `deepLinkURL`. It also details the `relationships` to associated `account`, `transferAccount`, `category`, `parentCategory`, `tags`, and `attachment` resources, along with the `links` for self-referencing the transaction. Note that this is a partial example and may require an enclosing object to form a complete, valid JSON structure. ```JSON "settledAt": "2025-05-16T04:00:00+10:00", "createdAt": "2025-05-16T04:00:00+10:00", "transactionType": null, "note": null, "performingCustomer": { "displayName": "Bobby" }, "deepLinkURL": "up://transaction/VHJhbnNhY3Rpb24tNDY=" }, "relationships": { "account": { "data": { "type": "accounts", "id": "45b273d4-190d-4e89-91e5-8dd05c8573c7" }, "links": { "related": "https://api.up.com.au/api/v1/accounts/45b273d4-190d-4e89-91e5-8dd05c8573c7" } }, "transferAccount": { "data": null }, "category": { "data": null, "links": { "self": "https://api.up.com.au/api/v1/transactions/c13c15c8-2010-44cb-8bba-809ce0bb527d/relationships/category" } }, "parentCategory": { "data": null }, "tags": { "data": [], "links": { "self": "https://api.up.com.au/api/v1/transactions/c13c15c8-2010-44cb-8bba-809ce0bb527d/relationships/tags" } }, "attachment": { "data": null } }, "links": { "self": "https://api.up.com.au/api/v1/transactions/c13c15c8-2010-44cb-8bba-809ce0bb527d" } } } ``` -------------------------------- ### Retrieving a Webhook - Sample Request (Shell) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command demonstrates how to retrieve a specific webhook by its unique identifier. It sends a `GET` request to the `/webhooks/{id}` endpoint, including the necessary authorization header. ```Shell curl https://api.up.com.au/api/v1/webhooks/e3bc931b-0796-4c8b-9fd0-73216dac29a2 \ -H 'Authorization: Bearer up:demo:8nx5I6KHXnPgXTQ7' ``` -------------------------------- ### Specifying Page Size in Up Banking API Requests Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This URL example shows how to use the "page[size]" query parameter to control the number of items returned per page in a paginated API response, here requesting 10 accounts. ```Plain Text https://api.up.com.au/api/v1/accounts?page[size]=10 ``` -------------------------------- ### Listing Accounts with cURL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve a list of accounts from the Up Bank API. It uses a GET request, includes an Authorization header with a bearer token, and limits the page size to 1 using a query parameter. ```curl curl https://api.up.com.au/api/v1/accounts \ -G \ -H 'Authorization: Bearer up:demo:bHaYEixyA5gBe9fy' \ -d 'page[size]=1' ``` -------------------------------- ### Testing API Authentication with Ping (Shell) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command sends an authenticated `GET` request to the `/util/ping` endpoint. It includes an `Authorization` header with a Bearer token, demonstrating how to verify successful API authentication. A `200` status is expected on success. ```Shell curl https://api.up.com.au/api/v1/util/ping \ -H 'Authorization: Bearer up:demo:TKLZ9UyzSn3iqwFR' ``` -------------------------------- ### Listing Tags: cURL Request Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve a paginated list of tags from the Up Bank API. It uses a GET request with an Authorization header and specifies a page size of 2. ```curl curl https://api.up.com.au/api/v1/tags \ -G \ -H 'Authorization: Bearer up:demo:XSPSAGE5Iytm0Lv5' \ -d 'page[size]=2' ``` -------------------------------- ### Filtering Transactions by Tag (HTTP) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This example demonstrates how to filter transactions by a specific tag using the `filter[tag]` query parameter. If the specified tag does not exist, the API will return zero records with a successful response. ```HTTP ?filter[tag]=Holiday ``` -------------------------------- ### Example Transaction Resource JSON Response Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object illustrates the structure and typical data returned by the Up Bank API when requesting a single transaction resource. It includes attributes like status, raw text, description, amounts, and card purchase method details. ```json { "data": { "type": "transactions", "id": "c13c15c8-2010-44cb-8bba-809ce0bb527d", "attributes": { "status": "SETTLED", "rawText": "WARUNG BEBEK, UBUD INDONES", "description": "Warung Bebek Bengil", "message": null, "isCategorizable": true, "holdInfo": { "amount": { "currencyCode": "AUD", "value": "-107.92", "valueInBaseUnits": -10792 }, "foreignAmount": null }, "roundUp": { "amount": { "currencyCode": "AUD", "value": "-0.08", "valueInBaseUnits": -8 }, "boostPortion": null }, "cashback": null, "amount": { "currencyCode": "AUD", "value": "-107.92", "valueInBaseUnits": -10792 }, "foreignAmount": { "currencyCode": "IDR", "value": "-1053698.77", "valueInBaseUnits": -105369877 }, "cardPurchaseMethod": { "method": "CARD_ON_FILE", "cardNumberSuffix": "0001" } } } } ``` -------------------------------- ### Verifying Access Token with cURL Ping Request Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to make a GET request to the /util/ping endpoint to verify the validity of your access token. The token is passed in the "Authorization" header using the Bearer scheme. ```bash curl https://api.up.com.au/api/v1/util/ping \ -H "Authorization: Bearer $your_access_token" ``` -------------------------------- ### Listing Up Bank Webhook Delivery Logs (cURL) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command retrieves delivery logs for a specified webhook. It uses the `GET` method (`-G`), includes an `Authorization` header, and demonstrates how to use the `page[size]` query parameter to limit the number of results per page. ```curl curl https://api.up.com.au/api/v1/webhooks/ced7aed4-39d9-4804-95e5-807ed17b8134/logs \ -G \ -H 'Authorization: Bearer up:demo:PKWr8V1TvhnQ5vp2' \ -d 'page[size]=1' ``` -------------------------------- ### Verifying Upbank Webhook Signature in Go Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This plain Go example demonstrates how to verify the `X-Up-Authenticity-Signature` header for incoming webhook events. It decodes the received signature from hex, computes the SHA-256 HMAC of the request body using `crypto/hmac` and `crypto/sha256`, and then securely compares the computed signature with the received one using `hmac.Equal`. The `secretKey` is required for HMAC computation. ```go import ( "crypto/hmac" "crypto/sha256" "encoding/hex" "io" "net/http" ) func handleWebhookEvent(w http.ResponseWriter, r *http.Request) { receivedSignature, _ := hex.DecodeString( r.Header.Get("X-Up-Authenticity-Signature"), ) mac := hmac.New(sha256.New, secretKey) io.Copy(mac, r.Body) signature := mac.Sum(nil) if hmac.Equal(signature, receivedSignature) // Process webhook event } } ``` -------------------------------- ### Filtering Transactions by End Date-Time (HTTP) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This example shows how to filter transactions up to a specific end date-time using the `filter[until]` query parameter. The date-time must adhere to RFC 3339 format. This parameter is not intended for pagination purposes. ```HTTP ?filter[until]=2020-02-01T01:02:03+10:00 ``` -------------------------------- ### Filtering Transactions by Category (HTTP) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This example illustrates filtering transactions by a specific category identifier using the `filter[category]` query parameter. Both parent and child categories can be used. Providing an invalid category identifier will result in a `404` response. ```HTTP ?filter[category]=good-life ``` -------------------------------- ### Testing API Authentication Failure with Ping (Shell) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command sends an unauthenticated `GET` request to the `/util/ping` endpoint. This is used to test scenarios where authentication fails, and a `401 Not Authorized` error response is expected, indicating missing or invalid credentials. ```Shell curl https://api.up.com.au/api/v1/util/ping ``` -------------------------------- ### Sample Upbank Webhook Event Payload Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON snippet provides an example of the payload structure for an Upbank webhook event. It illustrates a `TRANSACTION_CREATED` event, including its unique ID, creation timestamp, and relationships to the originating webhook and the specific transaction resource. This structure is sent as the raw request body for signature verification. ```json { "data": { "type": "webhook-events", "id": "01e60a74-cbee-400e-a633-7e3e6588d776", "attributes": { "eventType": "TRANSACTION_CREATED", "createdAt": "2025-05-19T18:12:39+10:00" }, "relationships": { "webhook": { "data": { "type": "webhooks", "id": "090e81f4-9c7f-4381-a0a4-c1e448be61b7" }, "links": { "related": "https://api.up.com.au/api/v1/webhooks/090e81f4-9c7f-4381-a0a4-c1e448be61b7" } }, "transaction": { "data": { "type": "transactions", "id": "09266b1a-26c5-4988-92f5-723204aa30fa" }, "links": { "related": "https://api.up.com.au/api/v1/transactions/09266b1a-26c5-4988-92f5-723204aa30fa" } } } } } ``` -------------------------------- ### Retrieving Specific Account with cURL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve a specific account by its unique identifier from the Up Bank API. It performs a GET request to the /accounts/{id} endpoint, including the necessary Authorization header with a bearer token. ```curl curl https://api.up.com.au/api/v1/accounts/bd0dc494-873c-483b-b522-270e48d5ee5c \ -H 'Authorization: Bearer up:demo:ZZOdI2ZvycR1kqoG' ``` -------------------------------- ### Verifying Upbank Webhook Signature in PHP Laravel Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This PHP example, using the Laravel framework, shows how to verify the `X-Up-Authenticity-Signature` header. It retrieves the raw request body and computes its SHA-256 HMAC signature using `hash_hmac` with the `secretKey`. The computed signature is then securely compared against the received signature using `hash_equals`. ```php public function handleWebhookEvent(Request $request) { $received_signature = $request->header( 'X-Up-Authenticity-Signature', '' ); $raw_body = $request->getContent(); $signature = hash_hmac('sha256', $raw_body, $this->secretKey); if (hash_equals($signature, $received_signature)) { // Process webhook event } } ``` -------------------------------- ### Querying Transactions for an Account (cURL) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to fetch transactions for a specific account from the Up Bank API. It uses a GET request, includes an authorization header, and applies filters for transaction status (HELD) and category (good-life), while limiting the page size to one result. ```bash curl https://api.up.com.au/api/v1/accounts/7e2095ac-9044-43ca-b9ec-60d94d70b473/transactions \n -G \n -H 'Authorization: Bearer up:demo:SVMxBQdWZPv0FAkP' \n -d 'page[size]=1' \n -d 'filter[status]=HELD' \n -d 'filter[category]=good-life' ``` -------------------------------- ### Verifying Upbank Webhook Signature in Ruby on Rails Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This Ruby example demonstrates how to verify the `X-Up-Authenticity-Signature` header in a Ruby on Rails application. It computes the SHA-256 HMAC signature of the raw request body using `OpenSSL::HMAC.hexdigest` and compares it securely with the received signature using `Rack::Utils.secure_compare`. The `secret_key` is a prerequisite for this verification. ```ruby require 'openssl' def handle_webhook_event received_signature = request.headers['X-Up-Authenticity-Signature'] signature = OpenSSL::HMAC.hexdigest( 'SHA256', secret_key, request.raw_post, ) if Rack::Utils.secure_compare(received_signature, signature) # Process webhook event end end ``` -------------------------------- ### Retrieve Transactions by Account API Endpoint - HTTP Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md Defines the HTTP GET endpoint for retrieving a paginated list of transactions for a given account. It specifies the `accountId` path parameter and various query parameters for filtering results by status, date range, category, and tag. Results are ordered newest first. ```HTTP ``` -------------------------------- ### Creating a Webhook - Sample Request (Shell) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command demonstrates how to create a new webhook by sending a `POST` request to the `/webhooks` endpoint. It includes the necessary authorization header, content type, and a JSON payload specifying the webhook URL and an optional description. ```Shell curl https://api.up.com.au/api/v1/webhooks \ -XPOST \ -H 'Authorization: Bearer up:demo:yuNWOUlolqaIyr7i' \ -H 'Content-Type: application/json' \ --data-binary '{ "data": { "attributes": { "url": "http://example.com/webhook", "description": "Example webhook" } } }' ``` -------------------------------- ### Sample Response for Listing Accounts Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a sample successful response when listing accounts. It includes an array of account resources, each with attributes like display name, type, balance, and creation date, along with relationship and self-links. Pagination links for 'prev' and 'next' are also provided. ```json { "data": [ { "type": "accounts", "id": "784e2e69-d1d5-4f94-a011-970283406a6c", "attributes": { "displayName": "Spending", "accountType": "TRANSACTIONAL", "ownershipType": "INDIVIDUAL", "balance": { "currencyCode": "AUD", "value": "1.00", "valueInBaseUnits": 100 }, "createdAt": "2025-05-19T18:12:14+10:00" }, "relationships": { "transactions": { "links": { "related": "https://api.up.com.au/api/v1/accounts/784e2e69-d1d5-4f94-a011-970283406a6c/transactions" } } }, "links": { "self": "https://api.up.com.au/api/v1/accounts/784e2e69-d1d5-4f94-a011-970283406a6c" } } ], "links": { "prev": null, "next": "https://api.up.com.au/api/v1/accounts?page%5Bafter%5D=WyIyMDI1LTA1LTE5VDA4OjEyOjE0LjY2MTQ5OTAwMFoiLCI3ODRlMmU2OS1kMWQ1LTRmOTQtYTAxMS05NzAyODM0NDZhNmMiXQ%3D%3D&page%5Bsize%5D=1" } } ``` -------------------------------- ### Sample JSON Response for Webhook Delivery Logs Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON array contains a sample webhook delivery log entry. It details the `request` body sent to the webhook, the `response` received (including status code and body), the `deliveryStatus`, and the `createdAt` timestamp of the log entry. Note that the provided snippet is truncated. ```JSON { "data": [\ {\ "type": "webhook-delivery-logs",\ "id": "a7144d65-f85c-4c3f-b004-7153c15b3f3b",\ "attributes": {\ "request": {\ "body": "{\"data\":{\"type\":\"webhook-events\",\"id\":\"fdc2ca33-b021-494f-b817-6e058ee39420\",\"attributes\":{\"eventType\":\"TRANSACTION_CREATED\",\"createdAt\":\"2025-05-18T18:13:41+10:00\"},\"relationships\":{\"webhook\":{\"data\":{\"type\":\"webhooks\",\"id\":\"ced7aed4-39d9-4804-95e5-807ed17b8134\"},\"links\":{\"related\":\"https://api.up.com.au/api/v1/webhooks/ced7aed4-39d9-4804-95e5-807ed17b8134\"}},\"transaction\":{\"data\":{\"type\":\"transactions\",\"id\":\"d12d2870-1b0d-47e2-83ba-db6c0acf7480\"},\"links\":{\"related\":\"https://api.up.com.au/api/v1/transactions/d12d2870-1b0d-47e2-83ba-db6c0acf7480\"}}}}}}" },\n "response": {\ "statusCode": 200,\ "body": "{\"ok\":true}"\ },\n "deliveryStatus": "DELIVERED",\ "createdAt": "2025-05-18T18:13:41+10:00"\ },\n "relationships": {\ "webhookEvent": {\ "data": {\ "type": "webhook-events",\ ``` -------------------------------- ### Sample Paginated Response Structure for Up Banking API Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON structure demonstrates how paginated responses from the Up Banking API are formatted. It includes a "data" array for resources and a "links" object with "prev" and "next" URLs for navigating between pages using opaque cursors. ```json { "data": [...], "links": { "prev": "https://api.up.com.au/api/v1/accounts?page[before]=x", "next": "https://api.up.com.au/api/v1/accounts?page[after]=y" } } ``` -------------------------------- ### Creating a Webhook - Sample Response (JSON) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a successful response after creating a webhook. It contains the newly created webhook's details, including its unique ID, URL, description, a one-time `secretKey`, creation timestamp, and related links. ```JSON { "data": { "type": "webhooks", "id": "9b70b3c4-599c-4ad6-81a5-66df62656d45", "attributes": { "url": "http://example.com/webhook", "description": "Example webhook", "secretKey": "xuDzAzOJF5bN4XXctZOHQ0HReOLEs8BNv7ryhutIR6XYtoCM2r4jtpcX4vqyozRS", "createdAt": "2025-05-19T18:12:39+10:00" }, "relationships": { "logs": { "links": { "related": "https://api.up.com.au/api/v1/webhooks/9b70b3c4-599c-4ad6-81a5-66df62656d45/logs" } } }, "links": { "self": "https://api.up.com.au/api/v1/webhooks/9b70b3c4-599c-4ad6-81a5-66df62656d45" } } } ``` -------------------------------- ### Listing Webhooks with cURL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve a list of webhooks from the Upbank API. It uses a bearer token for authorization and limits the page size to one entry for brevity. ```Shell curl https://api.up.com.au/api/v1/webhooks \ -G \ -H 'Authorization: Bearer up:demo:CBdIXIF18yjI3O1D' \ -d 'page[size]=1' ``` -------------------------------- ### Sample Transaction Response (JSON) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a sample response for a transaction query from the Up Bank API. It illustrates the structure of a single transaction resource, including its `type`, `id`, `attributes` (like status, description, amounts, dates), and `relationships` (such as the associated account). ```json { "data": [ { "type": "transactions", "id": "fc9eb982-fa6c-4c8a-a89e-9c9cc77d6e31", "attributes": { "status": "HELD", "rawText": "Spotify 0123456789", "description": "Spotify", "message": null, "isCategorizable": true, "holdInfo": { "amount": { "currencyCode": "AUD", "value": "-11.95", "valueInBaseUnits": -1195 }, "foreignAmount": null }, "roundUp": null, "cashback": null, "amount": { "currencyCode": "AUD", "value": "-11.95", "valueInBaseUnits": -1195 }, "foreignAmount": null, "cardPurchaseMethod": null, "settledAt": null, "createdAt": "2025-05-16T14:03:37+10:00", "transactionType": null, "note": null, "performingCustomer": { "displayName": "Bobby" }, "deepLinkURL": "up://transaction/VHJhbnNhY3Rpb24tNjk=" }, "relationships": { "account": { "data": { "type": "accounts", "id": "7e2095ac-9044-43ca-b9ec-60d94d70b473" } ``` -------------------------------- ### Sample Response for Retrieving Account Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object illustrates a successful response when retrieving a single account. It contains a single account resource with its type, ID, attributes (display name, account type, ownership, balance, creation date), relationships, and self-link. ```json { "data": { "type": "accounts", "id": "bd0dc494-873c-483b-b522-270e48d5ee5c", "attributes": { "displayName": "🐷 Savings", "accountType": "SAVER", "ownershipType": "INDIVIDUAL", "balance": { "currencyCode": "AUD", "value": "125.36", "valueInBaseUnits": 12536 }, "createdAt": "2025-05-19T18:12:16+10:00" }, "relationships": { "transactions": { "links": { "related": "https://api.up.com.au/api/v1/accounts/bd0dc494-873c-483b-b522-270e48d5ee5c/transactions" } } }, "links": { "self": "https://api.up.com.au/api/v1/accounts/bd0dc494-873c-483b-b522-270e48d5ee5c" } } } ``` -------------------------------- ### Sample JSON Response for Listing Attachments Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a sample successful response when listing attachments. It contains a 'data' array of 'AttachmentResource' objects, each detailing an attachment's attributes and relationships, along with 'links' for pagination. ```JSON { "data": [ { "type": "attachments", "id": "e962e451-026c-42b9-a750-f82322057507", "attributes": { "createdAt": "2025-05-19T18:12:17+10:00", "fileURL": "http://localhost:8080/asset/customer_transaction_attachment.jpg?filename=uploads%2Fcustomer_transaction_attachments%2Fmodels%2Fattachment%2Ffile%2F1%2Fattachment.jpg×tamp=1747642337&token=5407fedab6542e68f085aaaed7133022d7b59a3174ca59092c0076c99b17ea7e", "fileURLExpiresAt": "2025-05-19T18:27:17+10:00", "fileExtension": "jpg", "fileContentType": "image/jpeg" }, "relationships": { "transaction": { "data": { "type": "transactions", "id": "9daea8f1-a1ae-4bfa-9792-066af54901d8" }, "links": { "related": "https://api.up.com.au/api/v1/transactions/9daea8f1-a1ae-4bfa-9792-066af54901d8" } } }, "links": { "self": "https://api.up.com.au/api/v1/attachments/e962e451-026c-42b9-a750-f82322057507" } }, { "type": "attachments", "id": "fcb2349f-e4a5-4b56-a2df-764b1e4092f9", "attributes": { "createdAt": "2025-05-19T18:12:17+10:00", "fileURL": "http://localhost:8080/asset/customer_transaction_attachment.jpg?filename=uploads%2Fcustomer_transaction_attachments%2Fmodels%2Fattachment%2Ffile%2F2%2Fattachment.jpg×tamp=1747642337&token=f7b3f73e040300e657b7f2619298a11250003f7c3f0a6be1ae6c0e900fc37a9a", "fileURLExpiresAt": "2025-05-19T18:27:17+10:00", "fileExtension": "jpg", "fileContentType": "image/jpeg" }, "relationships": { "transaction": { "data": { "type": "transactions", "id": "fb5f5287-cab9-4c8f-8043-a4f9be85186d" }, "links": { "related": "https://api.up.com.au/api/v1/transactions/fb5f5287-cab9-4c8f-8043-a4f9be85186d" } } }, "links": { "self": "https://api.up.com.au/api/v1/attachments/fcb2349f-e4a5-4b56-a2df-764b1e4092f9" } } ], "links": { "prev": null, "next": null } } ``` -------------------------------- ### Sample Webhooks List JSON Response Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a sample response from the Upbank API when listing webhooks. It includes an array of webhook resources, each with its type, ID, attributes (URL, description, creation timestamp), relationships (e.g., logs), and self-links, along with pagination links. ```JSON { "data": [\ {\ "type": "webhooks",\ "id": "9c3d3078-ceba-4487-9db5-ff9d434fda08",\ "attributes": {\ "url": "http://example.com/webhook-1",\ "description": "Webhook number 1",\ "createdAt": "2025-05-17T18:12:38+10:00"\ },\n "relationships": {\ "logs": {\ "links": {\ "related": "https://api.up.com.au/api/v1/webhooks/9c3d3078-ceba-4487-9db5-ff9d434fda08/logs"\ }\ }\ },\n "links": {\ "self": "https://api.up.com.au/api/v1/webhooks/9c3d3078-ceba-4487-9db5-ff9d434fda08"\ }\ }\ ], "links": { "prev": null, "next": "https://api.up.com.au/api/v1/webhooks?page%5Bafter%5D=WyIyMDI1LTA1LTE3VDA4OjEyOjM4LjIwNjYyNzAwMFoiLCI5YzNkMzA3OC1jZWJhLTQ0ODctOWRiNS1mZjlkNDM0ZmRhMDgiXQ%3D%3D&page%5Bsize%5D=1" } } ``` -------------------------------- ### Initializing Code Display Constants and Array in React Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md Defines constants for the number of triangles, the interval for changing them, and initializes an array to hold formatted code snippets. The `arbitraryNumberOfTrianglesLongArray` is populated by mapping over a new array and formatting sliced code, indicating a dynamic source for the code content. ```JavaScript const numberOfTriangles = 1; const arbitraryNumberOfTrianglesLongArray = new Array(numberOfTriangles) .fill(1) .map((_, index) => formatCode(splitCode.slice(index * 2).join(''))); const changeIntervalMs = 1000; ``` -------------------------------- ### Sample Response for Up Banking API Ping Endpoint Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a successful response from the /util/ping endpoint, indicating that the access token is valid and the API is reachable. It includes metadata such as a unique ID and a status emoji. ```json { "meta": { "id": "3b5d17a4-6778-48dc-ae7d-9f8aace2e2fc", "statusEmoji": "⚡️" } } ``` -------------------------------- ### Sample Transaction Response (JSON) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a sample response from the Up Bank API when querying transactions. It shows a single transaction entry within the 'data' array, detailing its type, unique ID, various attributes (status, description, amount, timestamps), and relationships to other resources like accounts and tags. It also includes pagination links. ```json { "data": [\ {\ "type": "transactions",\ "id": "f4c72e71-6f7d-47ef-b2f5-c2ee18426a7c",\ "attributes": {\ "status": "SETTLED",\ "rawText": null,\ "description": "David Taylor",\ "message": "Money for the pizzas last night.",\ "isCategorizable": true,\ "holdInfo": null,\ "roundUp": null,\ "cashback": null,\ "amount": {\ "currencyCode": "AUD",\ "value": "-59.98",\ "valueInBaseUnits": -5998\ },\n "foreignAmount": null,\n "cardPurchaseMethod": null,\n "settledAt": "2025-05-18T11:10:31+10:00",\n "createdAt": "2025-05-18T11:10:31+10:00",\n "transactionType": null,\n "note": null,\n "performingCustomer": {\n "displayName": "Bobby"\n },\n "deepLinkURL": "up://transaction/VHJhbnNhY3Rpb24tMzg="\n },\n "relationships": {\n "account": {\n "data": {\n "type": "accounts",\n "id": "85aa6886-703e-4dac-a54e-557d1c306305"\n },\n "links": {\n "related": "https://api.up.com.au/api/v1/accounts/85aa6886-703e-4dac-a54e-557d1c306305"\n }\n },\n "transferAccount": {\n "data": null\n },\n "category": {\n "data": null,\n "links": {\n "self": "https://api.up.com.au/api/v1/transactions/f4c72e71-6f7d-47ef-b2f5-c2ee18426a7c/relationships/category"\n }\n },\n "parentCategory": {\n "data": null\n },\n "tags": {\n "data": [\n {\n "type": "tags",\n "id": "Pizza Night"\n }\n ],\ "links": {\ "self": "https://api.up.com.au/api/v1/transactions/f4c72e71-6f7d-47ef-b2f5-c2ee18426a7c/relationships/tags"\ }\ },\n "attachment": {\ "data": null\ }\ },\n "links": {\ "self": "https://api.up.com.au/api/v1/transactions/f4c72e71-6f7d-47ef-b2f5-c2ee18426a7c"\ }\ }\ ],\ "links": {\ "prev": null,\ "next": null\ }\ } ``` -------------------------------- ### Listing All Attachments using cURL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve a paginated list of all attachments from the Up Bank API. It requires an 'Authorization' header with a Bearer token to authenticate the request. ```Shell curl https://api.up.com.au/api/v1/attachments \ -H 'Authorization: Bearer up:demo:V4wkkRo5wRFdDMvk' ``` -------------------------------- ### Retrieving a Webhook - Sample Response (JSON) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a successful response when retrieving a specific webhook. It provides the webhook's details, including its ID, URL, description, creation timestamp, and a link to its related logs. ```JSON { "data": { "type": "webhooks", "id": "e3bc931b-0796-4c8b-9fd0-73216dac29a2", "attributes": { "url": "http://example.com/webhook-2", "description": "Webhook number 2", "createdAt": "2025-05-18T18:12:39+10:00" }, "relationships": { "logs": { "links": { "related": "https://api.up.com.au/api/v1/webhooks/e3bc931b-0796-4c8b-9fd0-73216dac29a2/logs" } } }, "links": { "self": "https://api.up.com.au/api/v1/webhooks/e3bc931b-0796-4c8b-9fd0-73216dac29a2" } } } ``` -------------------------------- ### Implementing Dynamic Code Block Display in React Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JavaScript/JSX snippet defines a set of React components and hooks for dynamically displaying code blocks. It includes `useTriangleIndex` for managing an index to cycle through code variations, `MemoizedCodeBlock` for rendering code with custom styling and layout (including 'triangle' shapes), and `MemoizedTriangleCode` which orchestrates the display of multiple code variations based on the `triangleIndex`. It's designed for interactive, animated code presentations. ```JSX const splitCode = sampleCode.split(''); const formatCode = code => code; const numberOfTriangles = 1;const arbitraryNumberOfTrianglesLongArray = new Array(numberOfTriangles) .fill(1) .map((_, index) => formatCode(splitCode.slice(index * 2).join(''))); const changeIntervalMs = 1000; const useTriangleIndex = () => { const [triangleIndex, setTriangleIndex] = useState(0); const updateTriangle = React.useCallback(() => { const newIndex = (triangleIndex + 1) % numberOfTriangles; setTriangleIndex(newIndex); }, [triangleIndex]); useInterval(updateTriangle, changeIntervalMs); return triangleIndex;}; type CodeBlockProps = {code: string}; const codeBlockStyle = {whiteSpace: 'normal', opacity: 0.8, lineBreak: 'anywhere'}; const leftTriangletyle = { shapeOutside: 'polygon(0 0, 100% 0, 0 100%)', height: 700,}; const rightTriangleStyle = { shapeOutside: 'polygon(0 0, 100% 0, 100% 100%)', height: 700,}; const MemoizedCodeBlock = React.memo(function Code({code}: CodeBlockProps) { return (
);}); const Triangle = function Triangle({className, code}: Props) { return (
); }; type ContainerProps = {| className: string, style: Object,|}; const MemoizedTriangleCode = React.memo(function TriangleCode({className, style}: ContainerProps) { const triangleIndex = useTriangleIndex(); return (
{arbitraryNumberOfTrianglesLongArray.map((code, index) => ( ))}
); }); export default MemoizedTriangleCode; ``` -------------------------------- ### Sample Error Response JSON Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This JSON object represents a typical error response from the Up Banking API, detailing the status, title, and specific details of an invalid request payload, including the source of the error. ```JSON { "errors": [{ "status": "422", "title": "Invalid Request Payload", "detail": "fixed value \"tags\" required", "source": { "pointer": "/data/0/type" } }] } ``` -------------------------------- ### Up Banking API Base URL Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This is the base URL for all API endpoints in version v1 of the Up Banking API. All specific endpoint paths must be appended to this URL. ```Plain Text https://api.up.com.au/api/v1 ``` -------------------------------- ### Implementing useTriangleIndex Hook for Cycling Display in React Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md A custom React hook that manages a `triangleIndex` state, which cycles through available code blocks at a defined interval. It leverages `useState` for state management, `useCallback` for memoizing the update function, and an assumed `useInterval` utility to trigger updates periodically. ```JavaScript const useTriangleIndex = () => { const [triangleIndex, setTriangleIndex] = useState(0); const updateTriangle = React.useCallback(() => { const newIndex = (triangleIndex + 1) % numberOfTriangles; setTriangleIndex(newIndex); }, [triangleIndex]); useInterval(updateTriangle, changeIntervalMs); return triangleIndex; }; ``` -------------------------------- ### Authentication Header Scheme for Up Banking API Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This snippet reiterates the standard "Authorization" header format required for all authenticated requests to the Up Banking API, using the Bearer token scheme. ```Plain Text Authorization: Bearer $your_access_token ``` -------------------------------- ### Querying Transactions with Filters (cURL) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This cURL command demonstrates how to retrieve transactions from the Up Bank API. It includes parameters for pagination (page size), filtering by a specific tag ('Pizza Night'), and filtering by transaction status ('SETTLED'). The Authorization header requires a Bearer token for authentication. ```shell curl https://api.up.com.au/api/v1/transactions \ -G \ -H 'Authorization: Bearer up:demo:7VWdOBW6EMTn7sNR' \ -d 'page[size]=1' \ -d 'filter[tag]=Pizza Night' \ -d 'filter[status]=SETTLED' ``` -------------------------------- ### Defining Styles for Code Blocks and Triangular Overlays in React Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md Defines inline style objects used for React components. `codeBlockStyle` controls text wrapping and opacity for the code display, while `leftTriangletyle` and `rightTriangleStyle` use CSS `shape-outside` with polygon values to create distinct triangular visual boundaries around content. ```JavaScript type CodeBlockProps = {code: string}; const codeBlockStyle = {whiteSpace: 'normal', opacity: 0.8, lineBreak: 'anywhere'}; const leftTriangletyle = { shapeOutside: 'polygon(0 0, 100% 0, 0 100%)', height: 700, }; const rightTriangleStyle = { shapeOutside: 'polygon(0 0, 100% 0, 100% 100%)', height: 700, }; ``` -------------------------------- ### Pinging an Up Bank Webhook (cURL) Source: https://github.com/vincenthopf/upbankapi/blob/main/README.md This `curl` command demonstrates how to send a PING request to a specific Up Bank webhook. It uses an `XPOST` method, includes an `Authorization` header with a bearer token, and sets the `Content-Type` to `application/json` with an empty body. This is used to test webhook connectivity. ```curl curl https://api.up.com.au/api/v1/webhooks/c28781aa-0993-4ed4-8044-db83a77871df/ping \ -XPOST \ -H 'Authorization: Bearer up:demo:zhjnEIEbVl5OTeNh' \ -H 'Content-Type: application/json' \ --data-binary '' ```