Send user data from API lookup by ID

API toolRecipe Tools

What it does

When someone makes an API request with a user ID, this automation validates the ID format and searches the lookup table. It returns the user data if found, or a 404 error if not.

Who it's for

Engineering teams who need to fetch user records via API without manual database queries.

How teams use this

Fetch user details by ID

Call the API with a numeric user ID to retrieve the matching record from the lookup table. The response includes all fields defined in the endpoint schema.

Integrate with a third-party application

Connect another system to this API endpoint so it can look up users by ID in real time without direct database access. The validation and lookup steps remain unchanged.

Add filtering by user status

Extend the lookup to check only active users by adding a status condition to the table search. Inactive users return a 404 even if the ID exists.

How it works

  1. Receive the API request. An API request arrives with a user ID parameter. The endpoint defines what data the response will include.
  2. Validate the ID format. Check that the ID is numeric using Workato Api Platform. If it is not, return a 400 error to the caller.
  3. Search the data table. Search the API User Data Table lookup table for an entry that matches the ID from the request.
  4. Return the result. If the entry exists, return a 200 response with the user data. If not found, return a 404 error.