Create issue from ORACLE procedure into GitLab


Do you know if it is possible to create a ORACLE procedure to insert an issue into GitLab ?

I was thinking to do something like :

l_json_clob clob;
l_json_response varchar2(15000);
l_wallet_loc_nopass varchar2(50) := ‘file:c:\oracle_wallet\WALLETS’;
l_gitlab_user varchar2(50) := ‘eric.sacramento’;
l_gitlab_pw varchar2(50) := ‘lkmasdpoadpaid’;
l_gitlab_api_create_issue varchar2(50) := ‘’;

apex_web_service.g_request_headers(1).name := ‘Content-Type’;
apex_web_service.g_request_headers(1).Value := ‘application/json’;

l_json_clob := ‘{
“project_id” : 4,
“id” : 84,
“created_at” : “2019-02-07T12:44:33.959Z”,
“iid” : 14,
“title” : “Create Issue From API”,
“state” : “opened”,
“assignees” : ,
“assignee” : null,
“labels” : [
l_json_response := apex_web_service.make_rest_request
( p_url => l_gitlab_api_create_issue
, p_http_method => ‘POST’
, p_username => l_gitlab_user
, p_password => l_gitlab_pw
, p_body => l_json_clob
, p_wallet_path => l_wallet_loc_nopass);

Thank you,

Just a heads up, and hopefully its not real… but there appears to be a password in the text that you posted…

it is a fake password!! thanks

Anyone ?

It appears that Oracle PL/SQL does support contacting external URLs (HTTP and HTTPS) for REST calls: and they appear to support JSON responses too (from my limited Oracle knowledge, so I may be incorrect).

Your example code appears to be doing the right things - have you tried running a simple operation to test? Do you encounter an error?

On the GitLab API service-end it does not matter what the client is, as long as the request is authorized and carries all the valid requirements (params, body, etc.).

Hi Harsh,

I have a similar working example using GitHub API, but now I need one for GitLab.

When I run my script I am getting this error now:

{“message”:“401 Unauthorized”}

Moreover, I don’t know how to pass the token on the code.

Thank you,

I put it to work, after adding the token

apex_web_service.g_request_headers(2).name := ‘PRIVATE-TOKEN’;
apex_web_service.g_request_headers(2).Value := ‘blablablablabla’;

Thank you.