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.h
andApexBridge.cpp
files into your Arduino project folder. - Include them in your sketch.
This library relies on the following:
WiFiClientSecure
for HTTPS requests.ArduinoJson
for 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!