Discussions
Categories
- 385.5K All Categories
- 5.1K Data
- 2.5K Big Data Appliance
- 2.5K Data Science
- 453.4K Databases
- 223.2K General Database Discussions
- 3.8K Java and JavaScript in the Database
- 47 Multilingual Engine
- 606 MySQL Community Space
- 486 NoSQL Database
- 7.9K Oracle Database Express Edition (XE)
- 3.2K ORDS, SODA & JSON in the Database
- 585 SQLcl
- 4K SQL Developer Data Modeler
- 188K SQL & PL/SQL
- 21.5K SQL Developer
- 46 Data Integration
- 46 GoldenGate
- 298.4K Development
- 4 Application Development
- 20 Developer Projects
- 166 Programming Languages
- 295K Development Tools
- 150 DevOps
- 3.1K QA/Testing
- 646.7K Java
- 37 Java Learning Subscription
- 37.1K Database Connectivity
- 201 Java Community Process
- 108 Java 25
- 22.2K Java APIs
- 138.3K Java Development Tools
- 165.4K Java EE (Java Enterprise Edition)
- 22 Java Essentials
- 176 Java 8 Questions
- 86K Java Programming
- 82 Java Puzzle Ball
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 94.3K Java SE
- 13.8K Java Security
- 208 Java User Groups
- 25 JavaScript - Nashorn
- Programs
- 667 LiveLabs
- 41 Workshops
- 10.3K Software
- 6.7K Berkeley DB Family
- 3.6K JHeadstart
- 6K Other Languages
- 2.3K Chinese
- 207 Deutsche Oracle Community
- 1.1K Español
- 1.9K Japanese
- 474 Portuguese
using Apex.Oracle.com - how can I call an API that is HTTPS..

I have developed a bot in Telegram.
I have an app built on https://apex.oracle.com/pls
I now want to call the telegram bot using below api call...
https://api.telegram.org/botxxxxxxxx-key/sendMessage?chat_id=999999&text="this is my message to telegram"
from the browser it works (obviously with the correct bot ID and the chat persons valid ID.
So all I need is my plsql code in apex.oracle.com to send that one line.
Alvin
Answers
-
- You first need to make sure the DB server can talk to that server.
- Then you need to make sure the schema in the DB can talk to that server.
- Iirc -
APEX_WEB_SERVICES.GET_REST()
would be what you use. (Actual name TBD. I'm on a phone)
Steps 1 & 2 might be impossible because your app is on apex.oracle.com
Either try with a local copy (using Oracle XE) or try with an Oracle Cloud Free Tier copy.
-
- If your protocol is https, you will need to add the endpoint domain's root certificate to your wallet and activate the wallet before a request.
- You will need to add ACL / ACE (Access Control) for the domain, before Oracle will instantiate a connection.
-
I need to try this.. will do and revert.. but would the apex_web_services be available from a DB procedure or must this be used on the APEX form ?
-
guys please note that I am using apex.oracle.com. so dont know where to add wallets or acls.
I dont have access to the backend Database and security features.
-
Whether you use APEX or not, Oracle is locked down in terms of endpoint connections, so you have no choice. It's to protect the DB - secure by default. So there's no avoiding it. You need to talk to your DBA.
-
I don't think there is a DBA the OP can talk to for
apex.oracle.com
-
D'oh for me, I wasn't paying attention.
Maybe OP needs to install Oracle XE and APEX locally then or post to the APEX forums to see if there's a workaround (e.g. local proxy, which maps local non SSL calls to external SSL calls etc).
-
The newer APEX versions (and apex.oracle.com is probably as recent as you can get it) have possibilities build into APEX (not into the database) that you can use to consume webservices. Mostly it is the APEX_WEB_SERVICE package that provides this functionality.
example
apex_web_service.make_rest_request_b ('https://raw.githubusercontent.com/TheEconomist/big-mac-data/master/source-data/big-mac-source-data.csv', 'GET')
However websources became way more declarative in recent versions.
Under shared components you have a bullet point to define a REST data source. Here is a small tutorial that explain how to use that. : https://oracle.github.io/learning-library/developer-library/apex/rest-data-source/?page=README&lab=3-defining-rest-data-source#Task2:AddRESTDataSourceforEMP
In your case you probably need to have a closer look into the authentication methods, but it should be possible. Under shared components/security/Web Credentials you can add credentials that your rest call might need to supply.
-
Thank you guys. I will check it out and revert if i am successful.