ApexBridge is a lightweight and efficient library designed for ESP8266 and ESP32 devices to seamlessly interact with Oracle APEX RESTful services. It simplifies sending authenticated HTTP requests and managing API endpoints securely.
- π Seamless API Communication: Easily interact with Oracle APEX RESTful services.
- π Secure Connections: Supports HTTPS with certificate validation.
- π Token-Based Authentication: Handles Bearer token authentication.
- π Built-in URL Management: Automatically constructs request URLs based on schema, module, and resources.
- β‘ Lightweight & Efficient: Designed for low-power IoT devices.
- Copy the
ApexBridge.handApexBridge.cppfiles into your Arduino project folder. - Include them in your sketch.
This library relies on the following:
WiFiClientSecurefor HTTPS requests.ArduinoJsonfor parsing JSON responses.
#include "ApexBridge.h" #include <ESP8266WiFi.h> #include <WiFiClientSecure.h>
String ssid = "<your-ssid>"; String password = "<your-password>";
X509List cert(ORACLE_APEX_CERTIFICATE); WiFiClientSecure clientApex;
String schema = "<your-schema>"; String base_path = "/pls/apex"; ApexBridge apex = ApexBridge(schema, base_path, clientApex);
void connectWifi(const char* ssid, const char* pwd) { WiFi.mode(WIFI_STA); WiFi.begin(ssid, pwd); while (WiFi.status() != WL_CONNECTED) { delay(500); } Serial.println("WiFi Connected"); }
apex.prepareURL("time", "now"); DynamicJsonDocument doc = apex.sendRequest("GET"); Serial.println(doc["full_timestamp"].as<String>());
Sets the authentication token for API requests.
Builds the full URL using the schema and provided module/resource.
Sends a request using the specified HTTP method (GET or POST).
Adds query parameters to the request URL.
apex.setToken("your-jwt-token"); apex.prepareURL("sensor", "data"); apex.addParameter("id", "123"); DynamicJsonDocument response = apex.sendRequest("GET"); Serial.println(response["status"].as<String>());
This project is licensed under the MIT License. See LICENSE for details.
- Author: Ata Can YaymacΔ±
- Medium: @atacanymc
- GitHub: AtaCanYmc
If you find this library useful, consider giving it a β on GitHub!
π Happy coding with ApexBridge!