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 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 Set the Profile Photo of an User in Microsoft Teams

Graph API w/ Java

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

public class TeamsSample {

  public static void main(String[] args) {
    ...

    Client client = ClientBuilder.newClient();

    client.target("https://graph.microsoft.com/v1.0/users/sampleUserId/photo/$value").request().header("Authorization", "...").put(Entity.entity(sampleProfilePhoto, "image/jpeg");

    client.close();
  }

}

Graph API w/ Go

package main

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

func main() {
  ...

  client := resty.New()

  client.R().SetHeader("Authorization", "...").SetHeader("Content-Type", "image/jpeg").SetBody(sampleProfilePhoto).Put("https://graph.microsoft.com/v1.0/users/sampleUserId/photo/$value")
}

Graph API w/ Node.js

const https = require('https')

...

var req = https.request({ headers: { 'Authorization': '...', 'Content-Type': 'image/jpeg' }, hostname: 'graph.microsoft.com', method: 'PUT', path: '/v1.0/users/sampleUserId/photo/$value' })

req.write(sampleProfilePhoto)

req.end()

Graph API w/ Python

import requests

...

requests.put('https://graph.microsoft.com/v1.0/users/sampleUserId/photo/$value', sampleProfilePhoto, headers = { 'Authorization': '...', 'Content-Type': 'image/jpeg' })

Graph API w/ Ruby

require 'rest-client'

...

RestClient.put 'https://graph.microsoft.com/v1.0/users/sampleUserId/photo/$value', sampleProfilePhoto, :authorization => '...', :content_type => 'image/jpeg'

Graph Java SDK

import com.microsoft.graph.authentication.IAuthenticationProvider;
import com.microsoft.graph.http.IHttpRequest;
import com.microsoft.graph.requests.extensions.GraphServiceClient;

public class TeamsSample {

  public static void main(String[] args) {
    ...

    GraphServiceClient.builder().authenticationProvider(new IAuthenticationProvider() {

      @Override
      public void authenticateRequest(IHttpRequest request) {
        request.addHeader("Authorization", "...");
      }

    }).buildClient().users("sampleUserId").photo().content().buildRequest().put(sampleProfilePhoto);
  }

}

Graph Node.js SDK

require('isomorphic-fetch')

const MicrosoftGraph = require('@microsoft/microsoft-graph-client')

...

var client = MicrosoftGraph.Client.initWithMiddleware({ authProvider: new class {

  getAccessToken() {
    return '...'
  }

} })

client.api('/users/sampleUserId/photo/$value').put(sampleProfilePhoto)

Graph Python SDK

Not supported.

Graph Ruby SDK

Not supported.

Software

How to Enable/Disable an User in Microsoft Teams

Graph 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.HttpUrlConnectorProvider;

public class TeamsSample {

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

    client.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true);

    Response res = client.target("https://graph.microsoft.com/v1.0/users/sampleUserId").request().header("Authorization", "...").method("PATCH", Entity.json("{ \"accountEnabled\": true }"));

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

    client.close();
  }

}

Graph 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/json").SetBody(`{ "accountEnabled": true }`).Patch("https://graph.microsoft.com/v1.0/users/sampleUserId")

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

}

Graph API w/ Node.js

const https = require('https')

var req = https.request({ headers: { 'Authorization': '...', 'Content-Type': 'application/json' }, hostname: 'graph.microsoft.com', method: 'PATCH', path: '/v1.0/users/sampleUserId' }, (res) => {

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

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

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

  }

}))

req.write('{ "accountEnabled": true }')

req.end()

Graph API w/ Python

import requests

res = requests.patch('https://graph.microsoft.com/v1.0/users/sampleUserId', json = { 'accountEnabled': True }, headers = { 'Authorization': '...' })

if res.ok:
  print(res.text)

Graph API w/ Ruby

require 'rest-client'

res = RestClient.patch 'https://graph.microsoft.com/v1.0/users/sampleUserId', '{ "accountEnabled": true }', :authorization => '...', :content_type => 'application/json'

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

Graph Java SDK

import com.microsoft.graph.authentication.IAuthenticationProvider;
import com.microsoft.graph.http.IHttpRequest;
import com.microsoft.graph.models.extensions.User;
import com.microsoft.graph.requests.extensions.GraphServiceClient;

public class TeamsSample {

  public static void main(String[] args) {
    User user = new User();

    user.accountEnabled = true;

    GraphServiceClient.builder().authenticationProvider(new IAuthenticationProvider() {

      @Override
      public void authenticateRequest(IHttpRequest request) {
        request.addHeader("Authorization", "...");
      }

    }).buildClient().users("sampleUserId").buildRequest().patch(user);
  }

}

Graph Node.js SDK

require('isomorphic-fetch')

const MicrosoftGraph = require('@microsoft/microsoft-graph-client')

var client = MicrosoftGraph.Client.initWithMiddleware({ authProvider: new class {

  getAccessToken() {
    return '...'
  }

} })

client.api('/users/sampleUserId').patch({ accountEnabled: true })

Graph Python SDK

Not supported.

Graph Ruby SDK

require 'json' # workaround for issue # 68
require 'net/http' # workaround for issue # 67

require 'microsoft_graph'
require 'nokogiri' # workaround for issue # 67

graph = MicrosoftGraph.new(cached_metadata_file: 'metadata_v1.0.xml') { |req| req.headers['Authorization'] = '...' } # workaround for issue # 66

user = graph.users.find('sampleUserId')

user.account_enabled = false

user.save!
Software

How to Consume an Atom Feed in Oracle HCM Cloud

Java

import static java.lang.System.out;

import java.net.Authenticator;
import java.net.PasswordAuthentication;
import java.net.URL;

import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;

public class HcmCloudSample {

  public static void main(String[] args) throws Exception {
    Authenticator.setDefault(new Authenticator() {

      public PasswordAuthentication getPasswordAuthentication() {
        return new PasswordAuthentication("user", "password".toCharArray());
      }

    });

    SyndFeed feed = new SyndFeedInput().build(new XmlReader(new URL("https://host/hcmRestApi/atomservlet/sampleWorkspace/sampleCollection"))); // also supports OAuth

    out.println(feed.getTitle());
  }

}

Go

package main

import (
  "fmt"
  "net/http"

  "github.com/mmcdole/gofeed"
)

func main() {
  fp := gofeed.NewParser()

  client := &http.Client{}

  req, _ := http.NewRequest("GET", "https://host/hcmRestApi/atomservlet/sampleWorkspace/sampleCollection", nil)

  req.SetBasicAuth("user", "password") // also supports OAuth

  res, _ := client.Do(req)

  feed, _ := fp.Parse(res.Body)

  fmt.Println(feed.Title)
}

Node.js

const https = require('https'), FeedMe = require('feedme')

var req = https.get({ auth: 'user:password', hostname: 'host', path: '/hcmRestApi/atomservlet/sampleWorkspace/sampleCollection' }, (res) => {

  if (res.statusCode === 200) {
    var fp = new FeedMe()

    fp.on('title', (title) => {
      console.log(title)
    })

    res.pipe(fp)
  }

}) // also supports OAuth

req.end()

Python

import atoma, requests
 
res = requests.get('https://host/hcmRestApi/atomservlet/sampleWorkspace/sampleCollection', auth = ( 'user', 'password' )) # also supports OAuth

feed = atoma.parse_atom_bytes(res.content)

print(feed.title.value)

Ruby

require 'open-uri'

require 'feedparser'

res = open('https://host/hcmRestApi/atomservlet/sampleWorkspace/sampleCollection', :http_basic_authentication => [ 'user', 'password' ]).read # also supports OAuth

feed = FeedParser::Parser.parse(res)

puts feed.title