Creating a Microservice to Fetch LinkedIn Profile Data

Building a microservice to retrieve LinkedIn profile details.

In this tutorial, you'll learn how to create a microservice that retrieves information from a LinkedIn profile URL. By the end, you'll have a working API that dynamically fetches and responds with profile data.

 

Step 1: Setting Up LinkedIn Data Scraper

  1. Add the LinkedIn Data Scraper node to your workflow.
  1. Select the action Get Profile Data by URL.
  1. Enter the LinkedIn profile URL in the designated field.
  1. Run the workflow to test it. Wait a few seconds to get the result. You'll see:

\- Name

\- Location

\- Job titles

\- Other profile details


Step 2: Converting the Workflow into a Microservice

  1. Replace the current TriggerNode with TriggerOnWebHook.
  1. This change generates a URL for the workflow. Copy the URL.
  1. Save and deploy the microservice.
  1. Test the microservice by calling it using the generated URL. You'll see a "Request accepted" message.
  1. Check the history to view the external call and inspect the input parameters. Currently, there are no parameters.

Step 3: Customizing the Microservice Response

  1. Add the Webhook Response node to the workflow.
  1. Pass the desired response content to this node. In this case, include the entire "Response" section, as it contains all the useful information.
  1. Select Response and save the changes.
  1. Deploy the microservice and ensure it's active.
  1. Call the microservice to verify the result. You'll receive a JSON response with complete profile information.

Step 4: Making the Profile URL Dynamic

  1. Currently, the profile URL is hardcoded. To make it dynamic:

\- Add a get parameter named "profile".

  1. Replace the static URL with the dynamic parameter.
  1. Test the microservice by calling it with the new parameter.
  1. Wait for the response.
  1. Check the history to view the incoming parameter.

\- Inspect the last call to see the input parameter containing the profile URL.

  1. Replay the scenario to load the data into the editor. Replace the static URL with the dynamic one from the input.
  1. Save and deploy the changes. Now, the microservice dynamically updates the profile URL based on the input.

Step 5: Testing with a Different Profile

  1. Call the microservice with a different profile, such as Chris's, by passing it as a get parameter.
  1. Verify the result. You'll see detailed information about Chris's profile.
  1. Review all the parameters in the response.

Your microservice is now ready to use!

Did this answer your question?
😞
😐
🤩