Software

How to Setup a Reverse Proxy in OHS on OCI

1) Create a new OCI Compute instance.

2) Download OHS 12.2.x from the Oracle Software Delivery Cloud and install it on the OCI Compute instance. The mod_proxy module is loaded by default.

3) Create a new OHS instance and configure it for TLS/SSL. You may need to add port 443 to a security list.

4) Add the following lines to the $ORACLE_HOME/config/fmwconfig/components/OHS/sample_instance/ssl.conf file:

<VirtualHost *:443>
  ...
  ProxyPass <Path> <Target URL>
  ProxyPassReverse <Path> <Target URL>
</VirtualHost>

5) Start OHS.

Refer to the docs for more information.

Software

How to Setup an URL Redirect in OCI API Gateway

1) In the OCI console, select “Developer Services → API Gateway” in the navigation menu, click on “Create Gateway”, enter a name in the “Name” field, select a type, compartment, VCN and subnet in the “Type”, “Compartment”, “Virtual Cloud Network in …” and “Subnet in …” dropdown menus, respectively, and click on “Create” if needed.

2) Select the gateway, open the “Deployments” page and click on “Create Deployment”.

3) Enter a name and a path prefix in the “Name” and “Path Prefix” fields, respectively, select a compartment in the “Compartment” dropdown menu and click on “Next”.

4) Enter a path in the “Path” field, select “GET” in the “Methods” field, select “Stock Response” in the “Type” field, enter “301”, “Location” and the redirect URL in the “Status Code”, “Header Name” and “Header Value” fields, respectively, and click on “Next”.

5) Click on “Create”.

Refer to the docs for more information.

Software

How to Check-Out a Load in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

REST API w/ Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;

public class WmsCloudSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    client.register(HttpAuthenticationFeature.basic("user", "password")); // also supports OAuth

    client.target("https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_out/").post(Entity.entity(Entity.entity("", MediaType.WILDCARD_TYPE)));

    client.close();
  }

}

REST API w/ Go

package main

import "github.com/go-resty/resty/v2"

func main() {
  client := resty.New()

  client.R().SetBasicAuth("user", "password").Post("https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_out/") // also supports OAuth
}

REST API w/ Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', hostname: 'host', method: 'POST', path: '/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_out/' }) // also supports OAuth

req.end()

REST API w/ Python

import requests

requests.post('https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_out/', auth = ( 'user', 'password')) # also supports OAuth

REST API w/ Ruby

require 'rest-client'

RestClient.post 'https://user:password@host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_out/' # also supports OAuth

REST API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.EntityloadApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic"); // also supports OAuth

    auth.setUsername("user");

    auth.setPassword("password");

    EntityloadApi api = new EntityloadApi();

    try {
      out.println(api.entityLoadCheckOutByIdPOST(sampleLoadId, "sampleDockNumber"));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

REST API Go SDK

package main

import (
  "context"
  "fmt"

  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.EntityloadApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  }) // also supports OAuth

  ret, res, _ := api.EntityLoadCheckOutByIdPOST(auth, sampleLoadId, "sampleDockNumber")

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

REST API Node.js SDK

const RestApi = require('rest_api');

client = RestApi.ApiClient.instance

var auth = client.authentications['basic'] // also supports OAuth

auth.username = 'user'

auth.password = 'password'

var api = new RestApi.EntityloadApi();

api.entityLoadCheckOutByIdPOST(sampleLoadId, 'sampleDockNumber', (err, data, res) => {

  if (res.statusCode === 200)
    console.log(data)

})

REST API Python SDK

from swagger_client import ApiClient, Configuration, EntityloadApi
from swagger_client.rest import ApiException

auth = Configuration() # also supports OAuth

auth.username = 'user'

auth.password = 'password'

api = EntityloadApi(ApiClient(auth))

try:
  res = api.entity_load_check_out_by_id_post(sampleLoadId, 'sampleDockNumber')

  print(res)
except ApiException as e:
  print(e)

REST API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth| # also supports OAuth
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::EntityloadApi.new

begin
  res = api.entity_load_check_out_by_id_post(sampleLoadId, 'sampleDockNumber')

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Check-In a Load in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

REST API w/ Java

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;

public class WmsCloudSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    client.register(HttpAuthenticationFeature.basic("user", "password")); // also supports OAuth

    client.target("https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_in/").request().post(Entity.json("{ \"options\": { \"dock_nbr\": \"sampleDockNumber\" } }"));

    client.close();
  }

}

REST API w/ Go

package main

import "github.com/go-resty/resty/v2"

func main() {
  client := resty.New()

  client.R().SetBasicAuth("user", "password").SetHeader("Content-Type", "application/json").SetBody(`{ "options": { "dock_nbr": "sampleDockNumber" } }`).Post("https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_in/") // also supports OAuth
}

REST API w/ Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', headers: { 'Content-Type': 'application/json' }, hostname: 'host', method: 'POST', path: '/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_in/' }) // also supports OAuth

req.write('{ "options": { "dock_nbr": "sampleDockNumber" } }')

req.end()

REST API w/ Python

import requests

requests.post('https://host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_in/', json = { 'options': { 'dock_nbr': 'sampleDockNumber' } }, auth = ( 'user', 'password' )) # also supports OAuth

REST API w/ Ruby

require 'rest-client'

RestClient.post 'https://user:password@host/env/wms/lgfapi/v10/entity/load/sampleLoadId/check_in/', '{ "options": { "dock_nbr": "sampleDockNumber" } }', :content_type => 'application/json' # also supports OAuth

REST API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.EntityloadApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic"); // also supports OAuth

    auth.setUsername("user");

    auth.setPassword("password");

    EntityloadApi = new EntityloadApi();

    try {
      out.println(api.entityLoadCheckInByIdPOST(sampleLoadId, "sampleDockNumber"));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

REST API Go SDK

package main

import (
  "context"
  "fmt"

  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.EntityloadApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  }) // also supports OAuth

  ret, res, _ := api.EntityLoadCheckInByIdPOST(auth, sampleLoadId, "sampleDockNumber")

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

REST API Node.js SDK

const RestApi = require('rest_api');

client = RestApi.ApiClient.instance

var auth = client.authentications['basic'] // also supports OAuth

auth.username = 'user'

auth.password = 'password'

var api = new RestApi.EntityloadApi();

api.entityLoadCheckInByIdPOST(sampleLoadId, 'sampleDockNumber', (err, data, res) => {

  if (res.statusCode === 200)
    console.log(data)

})

REST API Python SDK

from swagger_client import ApiClient, Configuration, EntityloadApi
from swagger_client.rest import ApiException

auth = Configuration() # also supports OAuth

auth.username = 'user'

auth.password = 'password'

api = EntityloadApi(ApiClient(auth))

try:
  res = api.entity_load_check_in_by_id_post(sampleLoadId, 'sampleDockNumber')

  print(res)
except ApiException as e:
  print(e)

REST API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth| # also supports OAuth
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::EntityloadApi.new

begin
  res = api.entity_load_check_in_by_id_post(sampleLoadId, 'sampleDockNumber')

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Get Inventory in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

REST API w/ Java

import static java.lang.System.out;
 
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Response;
 
import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
public class WmsCloudSample {
 
  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();
 
    client.register(HttpAuthenticationFeature.basic("user", "password")); // also supports OAuth
 
    Response res = client.target("https://host/env/wms/lgfapi/v10/entity/inventory?item_id=sampleItemId&location_id=sampleLocationId").request().get();
 
    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));
 
    client.close();
  }
 
}

REST API w/ Go

package main
 
import (
  "fmt"

  "github.com/go-resty/resty/v2"
)
 
func main() {
  client := resty.New()
 
  res, _ := client.R().SetBasicAuth("user", "password").Get("https://host/env/wms/lgfapi/v10/entity/inventory?item_id=sampleItemId&location_id=sampleLocationId") // also supports OAuth
 
  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }
 
}

REST API w/ Node.js

const https = require('https')

var req = https.get({ auth: 'user:password', hostname: 'host', path: '/env/wms/lgfapi/v10/entity/inventory?item_id=sampleItemId&location_id=sampleLocationId' }, (res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

}) // also supports OAuth
 
req.end()

REST API w/ Python

import requests

res = requests.get('https://host/env/wms/lgfapi/v10/entity/inventory?item_id=sampleItemId&location_id=sampleLocationId', auth = ( 'user', 'password' )) # also supports OAuth

print(res.text)

REST API w/ Ruby

require 'rest-client'

res = RestClient.get 'https://user:password@host/env/wms/lgfapi/v10/entity/inventory?item_id=sampleItemId&location_id=sampleLocationId' # also supports OAuth

if res.code == 200
  puts res.body
end

REST API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.EntityinventoryApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic"); // also supports OAuth

    auth.setUsername("user");

    auth.setPassword("password");

    EntityinventoryApi api = new EntityinventoryApi();

    try {
      out.println(api.entityInventoryGET(sampleItemId, sampleLocationId));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

REST API Go SDK

package main

import (
  "context"
  "fmt"

  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.EntityinventoryApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  })

  ret, res, _ := api.EntityInventoryGET(auth, &swagger.EntityinventoryApiEntityInventoryGETOpts {
    itemId: sampleItemId,
    locationId: sampeLocationId,
  }) // also supports OAuth

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

REST API Node.js SDK

const RestApi = require('rest_api');

client = RestApi.ApiClient.instance

var auth = client.authentications['basic'] // also supports OAuth

auth.username = 'user'

auth.password = 'password'

var api = new RestApi.EntityinventoryApi();

api.entityInventoryGET({ 'item_id': 0, 'location_id': 0 }, (err, data, res) => {

  if (res.statusCode === 200)
    console.log(data)

})

REST API Python SDK

from swagger_client import ApiClient, Configuration, EntityinventoryApi
from swagger_client.rest import ApiException

auth = Configuration() # also supports OAuth

auth.username = 'user'

auth.password = 'password'

api = EntityinventoryApi(ApiClient(auth))

try:
  res = api.entity_inventory_get(item_id=sampleItemId, location_id=sampleLocationId)

  print(res)
except ApiException as e:
  print(e)

REST API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth| # also supports OAuth
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::EntityinventoryApi.new

begin
  res = api.entity_inventory_get({ item_id = sampleItemId, location_id = sampleLocationId })

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Enable/Disable an User in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

Integration API w/ Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
public class WmsCloudSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    client.register(HttpAuthenticationFeature.basic("user", "password"));
 
    MultivaluedMap<String, String> params = new MultivaluedHashMap<String, String>();

    params.putSingle("xml_data", "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"); // flat_data not supported for user, must change password

    Response res = client.target("https://host/env/wms/api/init_stage_interface/").request().accept(MediaType.WILDCARD_TYPE).post(Entity.form(params));

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Integration API w/ Go

package main

import (
  "fmt"

  "github.com/go-resty/resty/v2"
)

func main() {
  client := resty.New()

  res, _ := client.R().SetBasicAuth("user", "password").SetHeader("Content-Type", "application/x-www-form-urlencoded").SetBody(`xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>`).Post("https://host/env/wms/api/init_stage_interface/") // flat_data not supported for user, must change password

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Integration API w/ Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, hostname: 'host', method: 'POST', path: '/env/wms/api/init_stage_interface/' }, (res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

req.write('xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>') // flat_data not supported for user, must change password

req.end()

Integration API w/ Python

import requests

res = requests.post('https://host/env/wms/api/init_stage_interface/', data = { 'xml_data': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, auth = ( 'user', 'password' )) # flat_data not supported for user, must change password

if res.ok:
  print(res.text)

Integration API w/ Ruby

require 'rest-client'

res = RestClient.post 'https://user:password@host/env/wms/api/init_stage_interface/', { xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' } # flat_data not supported for user, must change password

if res.code == 200
  puts res.body
end

Integration API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.DefaultApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic");

    auth.setUsername("user");

    auth.setPassword("password");

    DefaultApi api = new DefaultApi();

    try {
      out.println(api.initStageInterface(true, "", "", false, "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

Integration API Go SDK

package main

import (
  "context"
  "fmt"

  "github.com/antihax/optional"
  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.DefaultApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  })

  ret, res, _ := api.InitStageInterface(auth, &swagger.DefaultApiInitStageInterfaceOpts{
    XmlData: optional.NewString("<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"),
  })

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

Integration API Node.js SDK

const IntegrationApi = require('integration_api');

client = IntegrationApi.ApiClient.instance

var auth = client.authentications['basic']

auth.username = 'user'

auth.password = 'password'

var api = new IntegrationApi.DefaultApi();

api.initStageInterface({ 'xmlData': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, (err, data, res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

Integration API Python SDK

from swagger_client import ApiClient, Configuration, DefaultApi
from swagger_client.rest import ApiException

auth = Configuration()

auth.username = 'user'

auth.password = 'password'

api = DefaultApi(ApiClient(auth))

try:
  res = api.init_stage_interface(xml_data = '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>')

  print(res)
except ApiException as e:
  print(e)

Integration API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth|
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::DefaultApi.new

begin
  res = api.init_stage_interface({ xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><is_active>True</is_active><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>UPDATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' })

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Delete an User in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

Integration API w/ Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
public class WmsCloudSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    client.register(HttpAuthenticationFeature.basic("user", "password"));
 
    MultivaluedMap<String, String> params = new MultivaluedHashMap<String, String>();

    params.putSingle("xml_data", "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"); // flat_data not supported for user

    Response res = client.target("https://host/env/wms/api/init_stage_interface/").request().accept(MediaType.WILDCARD_TYPE).post(Entity.form(params));

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Integration API w/ Go

package main

import (
  "fmt"

  "github.com/go-resty/resty/v2"
)

func main() {
  client := resty.New()

  res, _ := client.R().SetBasicAuth("user", "password").SetHeader("Content-Type", "application/x-www-form-urlencoded").SetBody(`xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>`).Post("https://host/env/wms/api/init_stage_interface/") // flat_data not supported for user

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Integration API w/ Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, hostname: 'host', method: 'POST', path: '/env/wms/api/init_stage_interface/' }, (res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

req.write('xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>') // flat_data not supported for user

req.end()

Integration API w/ Python

import requests

res = requests.post('https://host/env/wms/api/init_stage_interface/', data = { 'xml_data': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, auth = ( 'user', 'password' )) # flat_data not supported for user

if res.ok:
  print(res.text)

Integration API w/ Ruby

require 'rest-client'

res = RestClient.post 'https://user:password@host/env/wms/api/init_stage_interface/', { xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' } # flat_data not supported for user

if res.code == 200
  puts res.body
end

Integration API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.DefaultApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic");

    auth.setUsername("user");

    auth.setPassword("password");

    DefaultApi api = new DefaultApi();

    try {
      out.println(api.initStageInterface(true, "", "", false, "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

Integration API Go SDK

package main

import (
  "context"
  "fmt"

  "github.com/antihax/optional"
  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.DefaultApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  })

  ret, res, _ := api.InitStageInterface(auth, &swagger.DefaultApiInitStageInterfaceOpts{
    XmlData: optional.NewString("<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"),
  })

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

Integration API Node.js SDK

const IntegrationApi = require('integration_api');

client = IntegrationApi.ApiClient.instance

var auth = client.authentications['basic']

auth.username = 'user'

auth.password = 'password'

var api = new IntegrationApi.DefaultApi();

api.initStageInterface({ 'xmlData': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, (err, data, res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

Integration API Python SDK

from swagger_client import ApiClient, Configuration, DefaultApi
from swagger_client.rest import ApiException

auth = Configuration()

auth.username = 'user'

auth.password = 'password'

api = DefaultApi(ApiClient(auth))

try:
  res = api.init_stage_interface(xml_data = '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>')

  print(res)
except ApiException as e:
  print(e)

Integration API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth|
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::DefaultApi.new

begin
  res = api.init_stage_interface({ xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>DELETE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' })

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Create an User in Oracle WMS Cloud

Oracle Integration Cloud

Oracle SOA Suite 12c on OCI

Integration API w/ Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import org.glassfish.jersey.client.authentication.HttpAuthenticationFeature;
 
public class WmsCloudSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    client.register(HttpAuthenticationFeature.basic("user", "password"));
 
    MultivaluedMap<String, String> params = new MultivaluedHashMap<String, String>();

    params.putSingle("xml_data", "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"); // flat_data not supported for user

    Response res = client.target("https://host/env/wms/api/init_stage_interface/").request().accept(MediaType.WILDCARD_TYPE).post(Entity.form(params));

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

Integration API w/ Go

package main

import (
  "fmt"

  "github.com/go-resty/resty/v2"
)

func main() {
  client := resty.New()

  res, _ := client.R().SetBasicAuth("user", "password").SetHeader("Content-Type", "application/x-www-form-urlencoded").SetBody(`xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>`).Post("https://host/env/wms/api/init_stage_interface/") // flat_data not supported for user

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

Integration API w/ Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, hostname: 'host', method: 'POST', path: '/env/wms/api/init_stage_interface/' }, (res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

req.write('xml_data=<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>') // flat_data not supported for user

req.end()

Integration API w/ Python

import requests

res = requests.post('https://host/env/wms/api/init_stage_interface/', data = { 'xml_data': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, auth = ( 'user', 'password' )) # flat_data not supported for user

if res.ok:
  print(res.text)

Integration API w/ Ruby

require 'rest-client'

res = RestClient.post 'https://user:password@host/env/wms/api/init_stage_interface/', { xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' } # flat_data not supported for user

if res.code == 200
  puts res.body
end

Integration API Java SDK

import static java.lang.System.out;

import io.swagger.client.ApiClient;
import io.swagger.client.ApiException;
import io.swagger.client.Configuration;
import io.swagger.client.api.DefaultApi;
import io.swagger.client.auth.HttpBasicAuth;

public class WmsCloudSample {

  public static void main(String[] args) {
    ApiClient client = Configuration.getDefaultApiClient();

    HttpBasicAuth auth = (HttpBasicAuth) client.getAuthentication("basic");

    auth.setUsername("user");

    auth.setPassword("password");

    DefaultApi api = new DefaultApi();

    try {
      out.println(api.initStageInterface(true, "", "", false, "<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"));
    } catch (ApiException e) {
      e.printStackTrace();
    }

  }

}

Integration API Go SDK

package main

import (
  "context"
  "fmt"

  "github.com/antihax/optional"
  "swagger"
)

func main() {
  client := swagger.NewAPIClient(swagger.NewConfiguration())

  api := client.DefaultApi

  auth := context.WithValue(context.Background(), swagger.ContextBasicAuth, swagger.BasicAuth{
    UserName: "user",
    Password: "password",
  })

  ret, res, _ := api.InitStageInterface(auth, &swagger.DefaultApiInitStageInterfaceOpts{
    XmlData: optional.NewString("<?xml version=\"1.0\" encoding=\"utf-8\"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>"),
  })

  if res.StatusCode == 200  {
    fmt.Printf("%s\n", ret)
  }

}

Integration API Node.js SDK

const IntegrationApi = require('integration_api');

client = IntegrationApi.ApiClient.instance

var auth = client.authentications['basic']

auth.username = 'user'

auth.password = 'password'

var api = new IntegrationApi.DefaultApi();

api.initStageInterface({ 'xmlData': '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' }, (err, data, res) => {

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

Integration API Python SDK

from swagger_client import ApiClient, Configuration, DefaultApi
from swagger_client.rest import ApiException

auth = Configuration()

auth.username = 'user'

auth.password = 'password'

api = DefaultApi(ApiClient(auth))

try:
  res = api.init_stage_interface(xml_data = '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>')

  print(res)
except ApiException as e:
  print(e)

Integration API Ruby SDK

require 'swagger_client'

SwaggerClient.configure do |auth|
  auth.username = 'user'

  auth.password = 'password'
end

api = SwaggerClient::DefaultApi.new

begin
  res = api.init_stage_interface({ xml_data: '<?xml version="1.0" encoding="utf-8"?><LgfData><Header><ClientEnvCode>API</ClientEnvCode><Entity>lgf_user</Entity><MessageId>Sample Message</MessageId></Header><ListOfLgfUsers><lgf_user><username>SAMPLEUSER</username><first_name>Sample</first_name><action_code>CREATE</action_code><last_name>User</last_name><password>SamplePassword</password><password_life_in_days>365</password_life_in_days><univ_id_1>1234</univ_id_1><hire_type>EMP</hire_type><date_joined>2020-06-07T00:00:00</date_joined><facility_code>0</facility_code><company_code>Sample Company</company_code><role>EMPLOYEE</role><lang_code>en_US</lang_code><rows_per_page>25</rows_per_page></lgf_user></ListOfLgfUsers></LgfData>' })

  puts res
rescue SwaggerClient::ApiError => e
  puts e
end

You can find the SDKs here.

Software

How to Generate a JSON Web Token (JWT) for Oracle Cloud Applications

REST API w/ Java

import static java.lang.System.out;

import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

public class IdcsSample {

  public static void main(String[] args) {
    Client client = ClientBuilder.newClient();

    MultivaluedMap<String, String> params = new MultivaluedHashMap<String, String>();

    params.putSingle("grant_type", "client_credentials");
    params.putSingle("scope", "sampleScope");

    Response res = client.target("https://host/oauth2/v1/token").request().header("Authorization", "...").post(Entity.form(params)); // auth token format is Client-ID:Client-Secret base64-encoded

    if (res.getStatus() == 200)
      out.println(res.readEntity(String.class));

    client.close();
  }

}

REST API w/ Go

package main

import (
  "fmt"

  "github.com/go-resty/resty/v2"
)

func main() {
  client := resty.New()

  res, _ := client.R().SetHeader("Authorization", "...").SetHeader("Content-Type", "application/x-www-form-urlencoded").SetBody(`grant_type=client_credentials&scope=sampleScope`).Post("https://host/oauth2/v1/token") // auth token format is Client-ID:Client-Secret base64-encoded

  if res.StatusCode() == 200 {
    fmt.Printf("%v\n", res)
  }

}

REST API w/ Node.js

const https = require('https')

var req = https.request({ headers: { 'Authorization': '...', 'Content-Type': 'application/x-www-form-urlencoded' }, hostname: 'host', method: 'POST', path: '/oauth2/v1/token' }, (res) => { // auth token format is Client-ID:Client-Secret base64-encoded

  if (res.statusCode === 200) {
    var body = ''

    res.on('data', (chunk) => {
      body += chunk.toString()
    })

    res.on('end', () => {
      console.log(body)
    })

  }

})

req.write('grant_type=client_credentials&scope=sampleScope')

req.end()

REST API w/ Python

import requests

res = requests.post('https://host/oauth2/v1/token', data = { 'grant_type': 'client_credentials', 'scope': 'sampleScope' }, headers = { 'Authorization': '...' })

if res.ok:
  print(res.text)

IDCS REST API w/ Ruby

require 'rest-client'

res = RestClient.post 'https://host/oauth2/v1/token', { grant_type: 'client_credentials', scope: 'sampleScope' }, :authorization => '...' # auth token format is Client-ID:Client-Secret base64-encoded

if res.code == 200
  puts res.body
end

Java SDK

import static java.lang.System.out;

import java.util.HashMap;
import java.util.Map;

import oracle.security.jps.idcsbinding.api.AuthenticationResult;
import oracle.security.jps.idcsbinding.api.OAuthToken;
import oracle.security.jps.idcsbinding.shared.AuthenticationManager;
import oracle.security.jps.idcsbinding.shared.AuthenticationManagerFactory;
import oracle.security.jps.idcsbinding.shared.IDCSTokenAssertionConfiguration;

public class IdcsSample {

  public static void main(String[] args) {
    Map<String, String> config = new HashMap<String, String>();

    config.put(IDCSTokenAssertionConfiguration.IDCS_CLIENT_ID, "sampleClientId");
    config.put(IDCSTokenAssertionConfiguration.IDCS_CLIENT_SECRET, "sampleClientSecret");
    config.put(IDCSTokenAssertionConfiguration.IDCS_CLIENT_TENANT, "sampleClientTenant");
    config.put(IDCSTokenAssertionConfiguration.IDCS_HOST, "host");
    config.put(IDCSTokenAssertionConfiguration.IDCS_PORT, "443");
    config.put("SSLEnabled", "true");

    AuthenticationManager mgr = AuthenticationManagerFactory.getInstance(new IDCSTokenAssertionConfiguration(config));

    AuthenticationResult res = mgr.clientCredentials("sampleScope");

    out.println(res.getToken(OAuthToken.TokenType.ACCESS_TOKEN).getToken());
  }

}

Node.js SDK

const IdcsAuthenticationManager = require ('./lib/idcsauthenticationmanager.js')

options = {
  ClientId: 'sampleClientId',
  ClientSecret: 'sampleClientSecret',
  ClientTenant: 'sampleClientTenant',
  IDCSHost: 'https://host'
}

mgr = new IdcsAuthenticationManager(options)

mgr.clientCredentials('sampleScope').then(function(res) {
  console.log(res)
})

Python SDK

from IdcsClient import *

options = {
  Constants.BASE_URL: 'https://host'
  Constants.CLIENT_ID: 'sampleClientId',
  Constants.CLIENT_SECRET: 'sampleClientSecret',
}

mgr = AuthenticationManager(options)

res = mgr.clientCredentials('sampleToken')

print(res.getAccessToken())
Software

How to Register an OAuth Client for Oracle HCM Cloud

1) In the IDCS console, click on “Add an Application”. Click on “Confidential Application”.

2) Enter a name in the “Name” field . Click on “Next”.

3) Select “Configure this application as a client now”, select “Client Credentials” and upload your signing certificate. Click on “+ Add Scope”, check the application and click on “Add”. Save the Scope. Click 2x on “Next”.

4) Click on “Finish”.

5) Save the Client ID and Client Secret. Click on “Close”.

You also need to contact My Oracle Support to request the setup on the HCM Cloud side.

Refer to the docs for more information.