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
25
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 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.

Created service reference

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 = "charlie.brown@peanuts.com" },
                            };

                    // 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

XML Examples

The Authentication Service (http://<address>/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>

DeleteOpportunity

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

© UKG Inc. All rights reserved. For a full list of UKG trademarks, visit www.ukg.com/trademarks. All other trademarks, if any, are the property of their respective owners. No part of this document or its content may be reproduced in any form or by any means or stored in a database or retrieval system without the prior written authorization of UKG Inc. (“UKG”). Information in this document is subject to change without notice. The document and its content are confidential information of UKG and may not be disseminated to any third party. Nothing herein constitutes legal advice, tax advice, or any other advice. All legal or tax questions or concerns should be directed to your legal counsel or tax consultant.

Liability/Disclaimer

UKG makes no representation or warranties with respect to the accuracy or completeness of the document or its content and specifically disclaims any responsibility or representation for other vendors’ software. The terms and conditions of your agreement with us regarding the software or services provided by us, which is the subject of the documentation contained herein, govern this document or content. All company, organization, person, and event references are fictional. Any resemblance to actual companies, organizations, persons, and events is entirely coincidental.

Links to Other Materials: The linked sites and embedded links are not under the control of UKG. We reserve the right to terminate any link or linking program at any time. UKG does not endorse companies or products to which it links. If you decide to access any of the third-party sites linked to the site, you do so entirely at your own risk.