REST API using Oracle PL/SQL UTL_HTTP package

REST API using Oracle PL/SQL UTL_HTTP package

Anonymous
Not applicable
5,108 Views
1 Reply
Message 1 of 2

REST API using Oracle PL/SQL UTL_HTTP package

Anonymous
Not applicable

Hi,

I am trying to use UTL_HTTP package in Oracle 11g to integrate Autodesk PLM to Oracle 11g. However, I am getting 500 error code for https://{mytenant}.autodeskplm360.net/rest/auth/1/login and HTML response for  https://{mytenant}.autodeskplm360.net/ .  I can able to see the HTML response for normal Url and 500 error for rest api url using UTL_HTTP.request(url).

 

 

Can I use Oracle PL/SQL as REST API to integrate Autodesk PLM and Oracle 11g?

If you have any examples please post.

 

Thanks in advance,

Prudhvi 

 

 

   

0 Likes
Accepted solutions (1)
5,109 Views
1 Reply
Reply (1)
Message 2 of 2

tony.mandatori
Autodesk
Autodesk
Accepted solution

As long as it can call ReST it should work.

 

But you need to have the headers and the body (payload) correct.

 

Body should look like this:

 

{
  "userID":"tony.mandatori@autodesk.com",
  "password": "xxxx"
}

Headers should be 

 

Accept=application/json
Content-Type=application/json

I noticed in the documentation for UTL_HTTP that you need to have a special package installed for calling HTTPS... so that might be the issue as well.

 

This is an odd way of integrating.  Login works with one call, but all your other calls are going to require multiple SQL statements - one to login and then the others to update the date (using the cookie you get back from FLC).

We usually script the ReST calls with a programming language like Java or C#.  PL/SQL doesn't feel like the right language for this sort of thing, although it will most likely work. 

 

0 Likes