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
- Add the LinkedIn Data Scraper node to your workflow.

- Select the action Get Profile Data by URL.

- Enter the LinkedIn profile URL in the designated field.

- 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
- Replace the current TriggerNode with TriggerOnWebHook.

- This change generates a URL for the workflow. Copy the URL.

- Save and deploy the microservice.
- Test the microservice by calling it using the generated URL. You'll see a "Request accepted" message.
- Check the history to view the external call and inspect the input parameters. Currently, there are no parameters.
Step 3: Customizing the Microservice Response
- Add the Webhook Response node to the workflow.

- Pass the desired response content to this node. In this case, include the entire "Response" section, as it contains all the useful information.
- Select Response and save the changes.

- Deploy the microservice and ensure it's active.
- Call the microservice to verify the result. You'll receive a JSON response with complete profile information.

Step 4: Making the Profile URL Dynamic
- Currently, the profile URL is hardcoded. To make it dynamic:
\- Add a get parameter named "profile".

- Replace the static URL with the dynamic parameter.

- Test the microservice by calling it with the new parameter.

- Wait for the response.

- Check the history to view the incoming parameter.

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

- Replay the scenario to load the data into the editor. Replace the static URL with the dynamic one from the input.

- Save and deploy the changes. Now, the microservice dynamically updates the profile URL based on the input.

Step 5: Testing with a Different Profile
- Call the microservice with a different profile, such as Chris's, by passing it as a get parameter.

- Verify the result. You'll see detailed information about Chris's profile.

- Review all the parameters in the response.

Your microservice is now ready to use!
Did this answer your question?
😞
😐
🤩