Development Opportunity Service
UKG Pro Web Services API Guide
Development Opportunity Service
Introduction
With UKG’s UKG Pro Web Services, you can leverage your UKG Pro data for solving business application and integration needs.
This document is intended for individuals who are familiar with software development and web service technologies.
Development Opportunity Service API
The UKG Pro Development Opportunity Service API enables the user to programmatically retrieve and update Development Opportunity information in UKG Pro.
Overview
This document describes the methods of the service and provides code examples using Microsoft’s Visual Studio 2008 using C# and XML (.NET Framework 3.0 or higher).
The following information describes the service requirements.
Service Specifications
- Protocol: Simple Object Access Protocol (SOAP) 1.2
- SSL Support: Required
Signup and Licensing
- Account Required: One of the following is required:
- UKG Pro Web User with Web Services permissions
- UKG Pro Service Account
Using a UKG Pro Service Account is recommended. For information regarding establishing and maintaining a UKG Pro Service Account, refer to the Manage Service Accounts guide located in the UKG Pro Learning Center Home > Content > System Management > Web Services.
Development Opportunity Object
The Development Opportunity object includes the following properties:
Property | Type | Length |
---|---|---|
OpportunityId | Int | |
ApplicationId | Int | |
Title | String | Required 100 |
Description | String | Required 1500 |
Course Code | String (Alphanumeric only, if set) | 25 |
Category | String (Must be a valid UKG Pro category, if set) | 6 |
Delivery Method | String | Computer-based = C Instructor-led = ILL Video = V Web-based = W |
License | String (Must be a valid UKG Pro License, if set) | 6 |
Provider | String | 10 |
Continuing Education Unit | Decimal | 0 - 9999999.99 |
Cost | Decimal | |
IntegrationId | String | |
Active | Boolean | |
URL | String | 200 |
CreatedBy | EmployeeIdentifier | |
UpdatedBy | EmployeeIdentifier |
Quick Start
This section provides steps for creating a sample application in your development environment to retrieve and update the Development Opportunity information.
Prerequisites
In order to use the service, you will need the following items:
- A UKG Pro Service Account username and password OR a UKG Pro Web User username and password
- The Customer API key from the UKG Pro Web Service administrative page
If you use a UKG Pro Service Account:
- You will need the User API key from the Service Account administrative page.
- You must have appropriate permissions granted to the Service Account for the Development Opportunity service on the Service Account administrative page.
If you use a UKG Pro Web User account, you will need the User API key from the Web Service administrative page.
Methods
This section introduces the API methods for the Development Opportunity Web Service.
-
GetOpportunityByIntegrationId: This method will be used to query by IntegrationId for an opportunity that has already been created in UKG Pro. The entire Development Opportunity object is returned.
-
GetOpportunityIdByIntegrationId: This helper method will be used to query by IntegrationId for an opportunity that has already been created in UKG Pro. Only the OpportunityId is returned.
-
CreateOpportunity: This method will be used to add a new development opportunity.
-
UpdateOpportunity: The method provides a way to update an existing development opportunity.
-
DeleteOpportunity: The method provides a way to delete a development opportunity. Please note, it is necessary to delete all participation records for all sessions, and then delete all sessions before deleting the opportunity.
C# Example
Generate the Service Reference
Once you have a user and API keys, you need to create a service reference to the DevelopmentOpportunity Service and the Person Service. In your development environment, add the service references.
In Visual Studio, select the Add Service Reference menu item from the Project menu. Once you enter the service information you should have the references display in the solution explorer.
Example Code
The following code is an example of retrieving Development Opportunity information from your UKG Pro data in a console application. You can copy the entire contents to a C# console application and update the following values and have an operable application.
See the methods section for an example of adding updates to your application.
UserName = "YOUR SERVICE ACCOUNT OR WEB USER NAME"
Password = "YOUR PASSWORD"
UserAPIkey = "YOUR USER API KEY"
CustomerAPIkey = "YOUR CUSTOMER API KEY"
// Example Quick Start Code Begin
namespace CareerDevelopmentApiGuides
{
using System;
using System.Linq;
using System.ServiceModel;
using System.ServiceModel.Channels;
using DevelopmentOpportunity;
using Login;
class Program
{
static void Main(string[] args)
{
LoginServiceClient loginClient = null;
try
{
// Setup your user credentials.
string UserName = "";
string Password = "";
string UserAPIkey = "";
string CustomerApiKey = "";
string Message = "";
string AuthenticationToken = "";
// Create a proxy to the login service.
loginClient = new LoginServiceClient("WSHttpBinding_ILoginService");
// Submit the login request to authenticate the user.
AuthenticationStatus loginRequest = loginClient.Authenticate
(CustomerApiKey, Password, UserAPIkey, UserName,
out Message, out AuthenticationToken);
if (loginRequest == AuthenticationStatus.Ok)
{
// User is authenticated and the authentication token is provided.
Console.WriteLine("User authentication successful.");
// Create Opportunity
CreateOpportunity(CustomerApiKey, AuthenticationToken);
}
else
{
// User authentication has failed. Review the message for details.
Console.WriteLine("User authentication failed: " + Message);
}
loginClient.Close();
Console.WriteLine("Press a key to exit");
Console.ReadKey(true);
}
catch (Exception ex)
{
loginClient.Abort();
Console.WriteLine("Exception:" + ex);
}
}
private static void CreateOpportunity(string customerApiKey,
string authenticationToken)
{
// Create a proxy to the development opportunity service.
DevelopmentOpportunityClient proxyOpportunity =
new DevelopmentOpportunityClient("WSHttpBinding_IDevelopmentOpportunity");
try
{
// Add the headers for the Customer API key and authentication token.
using (new OperationContextScope(proxyOpportunity.InnerChannel))
{
OperationContext.Current.OutgoingMessageHeaders
.Add(MessageHeader.CreateHeader("UltiProToken",
"http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken",
authenticationToken));
OperationContext.Current.OutgoingMessageHeaders
.Add(MessageHeader.CreateHeader("ClientAccessKey",
"http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey",
customerApiKey));
// Create an opportunity.
DevelopmentOpportunity.DevelopmentOpportunity newOpportunity =
new DevelopmentOpportunity.
DevelopmentOpportunity()
{
IntegrationId = Guid.NewGuid().ToString(),
Title = "Quick and Easy Cooking",
Description = "Simple recipes for everyday cooking",
CourseCode = "QEC101",
Cost = 85.00m,
Active = true,
CreatedBy = new EmailAddressIdentifier
{ EmailAddress = "[email protected]" },
};
// Submit the create.
DevelopmentOpportunityCreateResponse response =
proxyOpportunity.CreateOpportunity(new[] { newOpportunity });
// Check for errors.
if (response.HasErrors)
{
if(response.OperationResult.HasErrors)
{
// Review each operation error.
foreach (OperationMessage message in response.OperationResult.Messages)
{
Console.WriteLine("Operation Error Message: " + message.Message);
}
}
// Review result errors.
foreach (Result result in response.Results.Where(r => r.HasErrors))
{
// Review each error for this result.
foreach (OperationMessage message in result.Messages)
{
Console.WriteLine("Result "+ result.RequestNumber
+ " Error Message: " + message.Message);
}
}
}
else
{
// The create was successful.
Console.WriteLine("Create successful.");
}
}
proxyOpportunity.Close();
}
catch (Exception ex)
{
proxyOpportunity.Abort();
Console.WriteLine("Exception:" + ex);
}
}
}
}
// Example Quick Start Code End
XML Examples
The Authentication Service (http://
/services/LoginService) is required to get the Token needed for all Core Web Service Calls. Please refer to the UKG Pro Login Service API Guide for further information.CreateOpportunity
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.ultipro.com/services/developmentopportunity/IDevelopmentOpportunity/CreateOpportunity</a:Action>
<UltiProToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken">2956e54f-0eb5-42e2-a654-57028059caf7</UltiProToken>
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey>
</s:Header>
<s:Body>
<CreateOpportunity xmlns="http://www.ultipro.com/services/developmentopportunity">
<entities xmlns:b="http://www.ultipro.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:DevelopmentOpportunity>
<b:Active>true</b:Active>
<b:ApplicationId>10</b:ApplicationId>
<b:Category i:nil="true" />
<b:ContinuingEducationUnit>0</b:ContinuingEducationUnit>
<b:Cost>0</b:Cost>
<b:CourseCode>101</b:CourseCode>
<b:CreatedBy i:nil="true" />
<b:DeliveryMethod>W</b:DeliveryMethod>
<b:Description>Test course description</b:Description>
<b:IntegrationId>1001</b:IntegrationId>
<b:License i:nil="true" />
<b:OpportunityId>0</b:OpportunityId>
<b:Provider i:nil="true" />
<b:Title>Test course</b:Title>
<b:URL>http://sample.ultmatesoftware.com</b:URL>
<b:UpdatedBy i:nil="true" />
</b:DevelopmentOpportunity>
</entities>
</CreateOpportunity>
</s:Body>
</s:Envelope>
UpdateOpportunity
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.ultipro.com/services/developmentopportunity/IDevelopmentOpportunity/UpdateOpportunity</a:Action>
<UltiProToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken">2956e54f-0eb5-42e2-a654-57028059caf7</UltiProToken>
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey>
</s:Header>
<s:Body>
<UpdateOpportunity xmlns="http://www.ultipro.com/services/developmentopportunity">
<entities xmlns:b="http://www.ultipro.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:DevelopmentOpportunity>
<b:Active>true</b:Active>
<b:ApplicationId>10</b:ApplicationId>
<b:Category i:nil="true" />
<b:ContinuingEducationUnit>0</b:ContinuingEducationUnit>
<b:Cost>500</b:Cost>
<b:CourseCode i:nil="true" />
<b:CreatedBy i:nil="true" />
<b:DeliveryMethod>W</b:DeliveryMethod>
<b:Description i:nil="true" />
<b:IntegrationId>1001</b:IntegrationId>
<b:License i:nil="true" />
<b:OpportunityId>0</b:OpportunityId>
<b:Provider i:nil="true" />
<b:Title>Test course update</b:Title>
<b:URL>http://sample.ultmatesoftware.com</b:URL>
<b:UpdatedBy i:nil="true" />
</b:DevelopmentOpportunity>
</entities>
</UpdateOpportunity>
</s:Body>
</s:Envelope>
Delete Opportunity
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.ultipro.com/services/developmentopportunity/IDevelopmentOpportunity/DeleteOpportunity</a:Action>
<UltiProToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken">2956e54f-0eb5-42e2-a654-57028059caf7</UltiProToken>
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey>
</s:Header>
<s:Body>
<DeleteOpportunity xmlns="http://www.ultipro.com/services/developmentopportunity">
<entities xmlns:b="http://www.ultipro.com/contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<b:DevelopmentOpportunity>
<b:Active>false</b:Active>
<b:ApplicationId>10</b:ApplicationId>
<b:Category i:nil="true" />
<b:ContinuingEducationUnit>0</b:ContinuingEducationUnit>
<b:Cost>0</b:Cost>
<b:CourseCode i:nil="true" />
<b:CreatedBy i:nil="true" />
<b:DeliveryMethod i:nil="true" />
<b:Description i:nil="true" />
<b:IntegrationId>1001</b:IntegrationId>
<b:License i:nil="true" />
<b:OpportunityId>0</b:OpportunityId>
<b:Provider i:nil="true" />
<b:Title i:nil="true" />
<b:URL>http://sample.ultmatesoftware.com</b:URL>
<b:UpdatedBy i:nil="true" />
</b:DevelopmentOpportunity>
</entities>
</DeleteOpportunity>
</s:Body>
</s:Envelope>
GetOpportunityByIntegrationId
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.ultipro.com/services/developmentopportunity/IDevelopmentOpportunity/GetOpportunityByIntegrationId</a:Action>
<UltiProToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken">2956e54f-0eb5-42e2-a654-57028059caf7</UltiProToken>
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey>
</s:Header>
<s:Body>
<GetOpportunityByIntegrationId xmlns="http://www.ultipro.com/services/developmentopportunity">
<integrationId>1001</integrationId>
</GetOpportunityByIntegrationId>
</s:Body>
</s:Envelope>
GetOpportunityIdByIntegrationId
<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.ultipro.com/services/developmentopportunity/IDevelopmentOpportunity/GetOpportunityIdByIntegrationId</a:Action>
<UltiProToken xmlns="http://www.ultimatesoftware.com/foundation/authentication/ultiprotoken">2956e54f-0eb5-42e2-a654-57028059caf7</UltiProToken>
<ClientAccessKey xmlns="http://www.ultimatesoftware.com/foundation/authentication/clientaccesskey">UGIYS</ClientAccessKey>
</s:Header>
<s:Body>
<GetOpportunityIdByIntegrationId xmlns="http://www.ultipro.com/services/developmentopportunity">
<integrationId>1001</integrationId>
</GetOpportunityIdByIntegrationId>
</s:Body>
</s:Envelope>
Updated 2 months ago