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 Run a Bot in Automation Anywhere

W/o a Queue

Bot Deploy API w/ Java

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

public class AaeSample {

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

    client.target("https://host/v3/automations/deploy").request().header("X-Authorization", "...").post(Entity.json("{ \"fileId\": \"sampleBotId\", \"runAsUserIds\": [ \"sampleUserId\" ], \"callbackInfo\": { \"url\": \"sampleCallbackUrl\" } }"));

    client.close();
  }


}

Bot Deploy API w/ Go

package main

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

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

  client.R().SetHeader("X-Authorization", "...").SetBody(`{ "fileId": "sampleBotId", "runAsUserIds": [ "sampleUserId" ], "callbackInfo": { "url": "sampleCallbackUrl" } }`).Post("https://host/v3/automations/deploy")
}

Bot Deploy API w/ Node.js

const https = require('https')

var req = https.request({ headers: { 'X-Authorization': '...' }, hostname: 'host', method: 'POST', path: '/v3/automations/deploy' })

req.write('{ "fileId": "sampleBotId", "runAsUserIds": [ "sampleUserId" ], "callbackInfo": { "url", "sampleCallbackUrl" } }')

req.end()

Bot Deploy API w/ Python

import requests

requests.post('https://host/v3/automations/deploy', json = { 'fileId': 'sampleBotId', 'runAsUserIds': [ 'sampleUserId' ], 'callbackInfo': { 'url': 'sampleCallbackUrl' } }, headers = { 'X-Authorization': '...' })

Bot Deploy API w/ Ruby

require 'rest-client'

RestClient.post 'https://host/v3/automations/deploy', '{ "fileId": "sampleBotId", "runAsUserIds": [ "sampleUserId" ], "callbackInfo": { "url", "sampleCallbackUrl" } }', :x_authorization => '...'

W/ a Queue

Workload Management API w/ Java

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

public class AaeSample {

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

    client.target("https://host/v3/queues/sampleQueueId/workitems").header("X-Authorization", "...").post(Entity.json("{ \"workItems\": [ { \"json\": { ... } ] }"));

    client.close();
  }


}

Workload Management API w/ Go

package main

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

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

  client.R().SetHeader("X-Authorization", "...").SetBody(`{ "workItems": [ { "json": { ... } ] }`).Post("https://host/v3/queues/sampleQueueId/workitems")
}

Workload Management API w/ Node.js

const https = require('https')

var req = https.request({ headers: { 'X-Authorization': '...' }, hostname: 'host', method: 'POST', path: '/v3/queues/sampleQueueId/workitems' })

req.write('{ "workItems": [ { "json": { ... } ] }')

req.end()

Workload Management API w/ Python

import requests

requests.post('https://host/v3/queues/sampleQueueId/workitems', json = { 'workItems': [ { 'json': { ... } ] }, headers = { 'X-Authorization': '...' })

Workload Management API w/ Ruby

require 'rest-client'

RestClient.post 'https://host/v3/queues/sampleQueueId/workitems', '{ "workItems": [ { "json": { ... } ] }', :x_authorization => '...'
Software

How to Create an Incident in Oracle B2C Service

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 B2cServiceSample {

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

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

    client.target("https://host/services/rest/connect/v1.4/incidents").request().header("OSvC-CREST-Application-Context", "Sample Request").post(Entity.json("{ \"primaryContact\": { \"id\": sampleContactId }, \"subject\": \"Sample Incident\" }"));

    client.close();
  }

}

Go

package main

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

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

  client.R().SetBasicAuth("user", "password").SetHeader("OSvC-CREST-Application-Context", "Sample Request").SetBody(`{ "primaryContact": { "id": sampleContactId }, "subject": "Sample Incident" }`).Post("https://host/services/rest/connect/v1.4/incidents") // also supports OAuth
}

Node.js

const https = require('https')

var req = https.request({ auth: 'user:password', headers: { 'OSvC-CREST-Application-Context': 'Sample Request' }, hostname: 'host', method: 'POST', path: '/services/rest/connect/v1.4/incidents' }) // also supports OAuth

req.write('{ "primaryContact": { "id": sampleContactId }, "subject": "Sample Incident" }')

req.end()

Python

import requests

requests.post('https://host/services/rest/connect/v1.4/incidents', json = { 'primaryContact': { 'id': sampleContactId }, 'subject': 'Sample Incident' }, auth = ( 'user', 'password' ), headers = { 'OSvC-CREST-Application-Context': 'Sample Request' }) # also supports OAuth

Ruby

require 'rest-client'

RestClient.post 'https://user:password@host/services/rest/connect/v1.4/incidents', '{ "primaryContact": { "id": sampleContactId }, "subject": "Sample Incident" }', :osvc_crest_application_context => 'Sample Request' # also supports OAuth
Software

How to Create an Incident in Status.io

API w/ Java

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

public class StatusioSample {

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

    client.target("https://api.status.io/v2/incident/create").request().header("x-api-id", "...").header("x-api-key", "...").post(Entity.json("{ \"statuspage_id\": \"sampleStatusPageId\", \"all_infrastructure_affected\": \"0\", \"current_state\": 200, \"current_status\": 400, \"incident_details\": \"Sample Incident\", \"incident_name\": \"Sample Incident\", \"infrastructure_affected\": [ \"sampleComponentId-sampleContainerId\" ], \"social\": \"0\" }"));

    client.close();
  }

}

API w/ Go

package main

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

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

  client.R().SetHeader("Content-Type", "application/json").SetHeader("x-api-id", "...").SetHeader("x-api-key", "...").SetBody(`{ "statuspage_id": "sampleStatusPageId", "all_infrastructure_affected": "0", "current_state": 200, "current_status": 400, "incident_details": "Sample Incident", "incident_name": "Sample Incident", "infrastructure_affected": [ "sampleComponentId-sampleContainerId" ], "social": "0" }`).Post("https://api.status.io/v2/incident/create")
}

API w/ Node.js

const https = require('https')

var req = https.request({ headers: { 'Content-Type': 'application/json', 'x-api-id': '...', 'x-api-key': '...' }, hostname: 'api.status.io', method: 'POST', path: '/v2/incident/create' })

req.write('{ "statuspage_id": "sampleStatusPageId", "all_infrastructure_affected": "0", "current_state": 200, "current_status": 400, "incident_details": "Sample Incident", "incident_name": "Sample Incident", "infrastructure_affected": [ "sampleComponentId-sampleContainerId" ], "social": "0" }')

req.end()

API w/ Python

import requests

requests.post('https://api.status.io/v2/incident/create', json = { 'statuspage_id': 'sampleStatusPageId', 'all_infrastructure_affected': '0', 'current_state': 200, 'current_status': 400, 'incident_details': 'Sample Incident', 'incident_name': 'Sample Incident', 'infrastructure_affected': [ 'sampleComponentId-sampleContainerId' ], 'social': '0' }, headers = { 'x-api-id': '...', 'x-api-key': '...' })

API w/ Ruby

require 'rest-client'

RestClient.post 'https://api.status.io/v2/incident/create', '{ "statuspage_id": "sampleStatusPageId", "all_infrastructure_affected": "0", "current_state": 200, "current_status": 400, "incident_details": "Sample Incident", "incident_name": "Sample Incident", "infrastructure_affected": [ "sampleComponentId-sampleContainerId" ], "social": "0" }', :content_type => 'application/json', :x_api_id => '...', :x_api_key => '...'

Go Client

package main

import "github.com/statusio/statusio-go"

func main() {
  api := statusio.NewStatusioApi("...", "...")

  api.IncidentCreate(statusio.Incident{
    StatuspageID: "sampleStatusPageId",
    AllInfrastructureAffected: "0",
    CurrentState: statusio.StateIdentified,
    CurrentStatus: statusio.StatusPartialServiceDisruption,
    IncidentDetails: "Sample Incident",
    IncidentName: "Sample Incident",
    InfrastructureAffected: []string { "sampleComponentId-sampleContainerId" },
    Social: "0",
  })
}

Node.js Client

const statusio = require('statusio')

var api = new statusio.StatusIOApi('...', '...')

api.setStatusPage('sampleStatusPageId')

api.incidents.create({ all_infrastructure_affected: '0', current_state: 200, current_status: 400, incident_details: 'Sample Incident', incident_name: "Sample Incident", infrastructure_affected: [ 'sampleComponentId-sampleContainerId' ], social: '0' })

Python Client

import statusio

api = statusio.Api('...', '...')

api.IncidentCreate('sampleStatusPageId', [ 'sampleComponentId-sampleContainerId' ], 'Sample Incident', 'Sample Incident', 400, 200)

Ruby Client

require 'statusio'

api = StatusioClient.new('...', '...')

api.incident_create('sampleStatusPageId', 'Sample Incident', 'Sample Incident', [ 'sampleComponentId-sampleContainerId' ], StatusioClient::STATUS_PARTIAL_SERVICE_DISRUPTION, StatusioClient::STATE_IDENTIFIED)