/talent-solutions-java-sdk

Repo for talent-solutions-java-sdk project

Primary LanguageJavaBSD 2-Clause "Simplified" LicenseBSD-2-Clause

LinkedIn-Talent-Solutions-SDK-Java-Client-Library

The LinkedIn Talent Solutions (LTS) Java SDK is the client library that enables seamless integration with LinkedIn's Talent APIs. The SDK offers specialized client implementations for different business use cases like Apply Connect, Job Posting, Pay-for-Performance (P4P), etc.

Understanding roles

Partner

Partners are organizations that have a direct integration agreement with LinkedIn. They act as intermediaries between LinkedIn and their customers (typically employers or recruiters). They perform the following functions:

  • Provision and manage customer applications
  • Act on behalf of their customers to post jobs
  • Access aggregated reporting and analytics
  • Manage billing and contracts for P4P services

Customer

Customers are the end users of the partner's services - typically employers, recruiters, or companies looking to post jobs on LinkedIn. They perform the following functions:

  • Post jobs on LinkedIn via the partner
  • Receive applications from job applicants
  • Access reports and analytics related to their job postings

Getting started

Prerequisites

  • Java 1.8 or later

Step 1: Configure your project

Insert dependency and repository code snippets into your project. Implement the snippets for Gradle or Maven projects as follows:

For Gradle

Update your build.gradle file with the following repository and dependency configurations:

repositories {
    maven {
        url "https://linkedin.jfrog.io/artifactory/talent-solutions-java-sdk/"
    }
    mavenCentral()
}

dependencies {
    implementation "com.linkedin:talent-solutions-java-sdk:1.0.0-alpha"
}

For Maven

Update your pom.xml file with the following repository and dependency configurations:

<repositories>
    <repository>
        <id>public-jfrog</id>
        <url>https://linkedin.jfrog.io/artifactory/talent-solutions-java-sdk/</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.linkedin</groupId>
    <artifactId>talent-solutions-java-sdk</artifactId>
    <version>1.0.0-alpha</version>
</dependency>

Note

If you are not using Gradle or Maven, you need to manually download JAR files from Jfrog and add it to your project's classpath.

Step 2: Review SDK clients and API documentation

The API operations are organized by business use case. As a LinkedIn partner, learn about the clients that align with your specific integration requirements.

ProvisioningClient

Manage customer onboarding by creating and configuring child developer applications. Refer to the Provisioning API to learn more.

Important

The ProvisioningClient must be used first to create child developer applications, which generate the customer credentials (client_id and client_secret) required to authenticate and use all other API clients (JobPostingClient, P4PJobPostingClient, ApplyConnectJobPostingClient).

The API supports the following use cases:

JobPostingClient

Post and manage basic job listings on LinkedIn's platform. Refer to the Job Posting API to learn more.

The API supports the following use cases:

P4PJobPostingClient

Create pay-for-performance job campaigns with enhanced visibility and detailed performance analytics. Refer to the LinkedIn P4P (Pay For Performance) Job Posting and Reports APIs to learn about posting promoted jobs and retrieve reports of the P4P jobs, respectively.

The API supports the following use cases:

ApplyConnectJobPostingClient

Enable LinkedIn-hosted applications with customizable screening questions and real-time candidate notifications. Refer to the LinkedIn Apply Connect Job Posting APIs to learn more.

Step 3: Implement the SDK

The following examples demonstrate how to instantiate and use each SDK client. Each example includes the complete code needed to perform operations, from creating client instances to handling responses.

Important

Before using JobPostingClient, P4PJobPostingClient, or ApplyConnectJobPostingClient, you must first call the create operation of ProvisioningClient to generate your customer's client_id and client_secret. These credentials are required to authenticate and use all other API clients.

ProvisioningClient

// Create ProvisioningClient instance using partner credentials
ProvisioningClient provisioningClient = LinkedInClientFactory.getInstance()
    .getProvisioningClient("partner-clientid","partner-clientsecret");

// Use ProvisioningClient to create customer applications
// This will generate customer credentials needed for other clients

Basic JobPosting

Create Basic JobPosting
// Create JobPostingClient instance using customer credentials
JobPostingClient jobPostingClient = LinkedInClientFactory.getInstance()
    .getJobPostingClient("customer-clientid", "customer-clientsecret");

// Build JobPosting object
JobPosting jobPosting = JobPosting.builder()
    .externalJobPostingId("external job posting id")
    .companyId("companyId")
    .companyApplyUrl("https://careers.yourcompany.com")
    .jobPostingOperationType(JobPostingOperationType.CREATE)
    .title("Software Developer in Test")
    .description("Testing Job")
    .location("Sunnyvale, California")
    .listedAt(System.currentTimeMillis())
    .listingType(ListingType.BASIC)
    .employmentStatus(EmploymentStatus.FULL_TIME)
    .workplaceTypes(Arrays.asList(WorkplaceTypes.ON_SITE))
    .build();

// Build JobPostingRequest
JobPostingRequest jobPostingRequest = JobPostingRequest.builder()
    .elements(Arrays.asList(jobPosting))
    .build();

// Send JobPostingRequest
APIResponse<JobPostingResponse> jobPostingResponse = jobPostingClient.processJobPosting(jobPostingRequest);
Checking JobPosting Task Status
APIResponse<JobTaskStatusResponse> jobTaskStatusResponse = jobPostingClient
    .getTaskStatus(Arrays.asList("linkedin task urn"));
Checking Job Status
APIResponse<JobPostingStatus> jobPostingStatus = jobPostingClient
    .getJobPostingStatus(Arrays.asList("job posting id"));

P4P JobPosting

Create P4P JobPosting
// Create P4PJobPostingClient instance using customer credentials
P4PJobPostingClient p4pJobPostingClient = LinkedInClientFactory.getInstance()
    .getP4PJobPostingClient("customer-clientid", "customer-clientsecret");

// Build P4PBudget instance for P4P JobPosting Request
P4PBudget p4PBudget = P4PBudget.builder()
    .payForPerformanceTotalBudget(MoneyAmount.builder()
        .amount("5.00")
        .currencyCode(CurrencyCode.USD)
        .build())
    .build();

JobPosting jobPosting = JobPosting.builder()
    .externalJobPostingId("external job posting id")
    .companyId("companyId")
    .companyApplyUrl("https://careers.yourcompany.com")
    .contract("urn:li:contract:{your-contract_id}")
    .companyJobCode("ATS-source-requisition_id_or_externalJobPostingId")
    .jobPostingOperationType(JobPostingOperationType.CREATE)
    .title("Software Developer in Test")
    .description("Testing Job")
    .location("Sunnyvale, California")
    .listedAt(System.currentTimeMillis())
    .listingType(ListingType.BASIC)
    .employmentStatus(EmploymentStatus.FULL_TIME)
    .workplaceTypes(Arrays.asList(WorkplaceTypes.ON_SITE))
    .p4PBudget(p4PBudget)
    .build();

// Build JobPostingRequest
JobPostingRequest jobPostingRequest = JobPostingRequest.builder()
    .elements(Arrays.asList(jobPosting))
    .build();

// Send JobPostingRequest using P4PJobPostingClient
APIResponse<JobPostingResponse> jobPostingResponse = p4pJobPostingClient.processJobPosting(jobPostingRequest);

Note

The taskStatus and jobPostingStatus handling for P4P Job Postings remains consistent with that of basic job postings. However, all related operations will be performed using the P4PJobPostingClient.

Retrieve P4PJobPerformanceReports By Ids
P4PJobReportsRequestByIds p4PJobReportsRequestByIds = P4PJobReportsRequestByIds
    .builder()
    .ids(Arrays.asList("external job posting id"))
    .dateRange(DateRange.builder()
        .start(Date.builder().day(10).month(05).year(2025).build())
        .end(Date.builder().day(12).month(05).year(2025).build())
        .build())
    .partnerContractId("enter partner contract id")
    .build();

APIResponse<P4PReportResponseByIds> p4PReportResponseByIds = p4pJobPostingClient
    .getP4PReportByIds(p4PJobReportsRequestByIds);
Retrieve P4PJobPerformanceReports By Date
P4PJobReportsRequestByDate p4PJobReportsRequestByDate = P4PJobReportsRequestByDate
    .builder()
    .dateRange(DateRange.builder()
        .start(Date.builder().day(10).month(05).year(2025).build())
        .end(Date.builder().day(12).month(05).year(2025).build())
        .build())
    .partnerContractId("enter partner contract id")
    .build();

APIResponse<P4PReportResponseByDate> p4PReportResponseByDate = p4pJobPostingClient
    .getP4PReportsByDate(p4PJobReportsRequestByDate);
Retrieve Budget Reports
APIResponse<P4PBudgetReportResponse> p4PBudgetReportResponse = p4pJobPostingClient
    .getPartnerBudgetReports("enter partner contract id");

ApplyConnect JobPosting

Create JobPosting with ApplyConnect
// Create ApplyConnectJobPostingClient instance using customer credentials
ApplyConnectJobPostingClient applyConnectJobPostingClient = LinkedInClientFactory.getInstance()
    .getApplyConnectJobPostingClient("customer-clientid", "customer-clientsecret");

// Build OnsiteApplyConfiguration for ApplyConnect JobPosting. 
// You have to customize SimpleTalentQuestions as per your need.
OnsiteApplyConfiguration onsiteApplyConfiguration = OnsiteApplyConfiguration
    .builder()
    .jobApplicationWebhookUrl("https://yourcompany.com/webhook")
    .questions(SimpleTalentQuestions.builder()
        .additionalQuestions(additionalQuestions)
        .build())
    .build();

JobPosting jobPosting = JobPosting.builder()
    .externalJobPostingId("external job posting id")
    .companyId("companyId")
    .companyApplyUrl("https://careers.yourcompany.com")
    .jobPostingOperationType(JobPostingOperationType.CREATE)
    .title("Software Developer in Test")
    .description("Testing Job")
    .location("Sunnyvale, California")
    .listedAt(System.currentTimeMillis())
    .listingType(ListingType.BASIC)
    .employmentStatus(EmploymentStatus.FULL_TIME)
    .workplaceTypes(Arrays.asList(WorkplaceTypes.ON_SITE))
    .onsiteApplyConfiguration(onsiteApplyConfiguration)
    .build();

// Build JobPostingRequest
JobPostingRequest jobPostingRequest = JobPostingRequest.builder()
    .elements(Arrays.asList(jobPosting))
    .build();

// Send JobPostingRequest using ApplyConnectJobPostingClient
APIResponse<JobPostingResponse> jobPostingResponse = applyConnectJobPostingClient
    .processJobPosting(jobPostingRequest);

Note

The taskStatus and jobPostingStatus handling for ApplyConnect Job Postings remains consistent with that of basic job postings. However, all related operations should be performed using the ApplyConnectJobPostingClient.