How to import API Collection in UiPath and extract response data from it?

Is is possible to import API collection in UiPath and extract the response parameters from it to validate. I have the API collection exported from postman.

Any suggestions on the same would be helpful.

can you please help with some more elaborations.

Are you looking for coding the API Collection file and Response extractions?

OR

Are you looking for importing the API Collection and getting it mapped to activities?
(this is current in preview, https://docs.uipath.com/integration-service/automation-cloud/latest/user-guide/building-your-custom-connector )

Yes, I have the API collection json file. From which I need to perform the validations. In UiPath Studio, I see HTTPRequest activity, where I’m unable to import the API collection json file contents.

I’m looking for a way to import the file in Studio and further perform the validation of the response.

(this is current in preview, Integration Service - Building your custom connector )

Does this have to be done in Orchestrator or how can it be done in Studio?

@ppr - did you have any update on this?

above statement we are not sure what is targeted in detail

As we can use / consume the collection.json aside we could do:

  • fetch the response schema from the Collection.json
  • do the call with Http Request
  • compare reponse with the extracted schema

But we do feel that you are looking more on an integrated schema driven validation

Hi @kaustubh.aras28

  1. Export from Postman:
    Export your Postman collection in a format that can be parsed by UiPath. JSON format is the most common choice for this purpose.

  2. Read the Exported Collection in UiPath:
    UiPath has activities to work with JSON files. You can use the Deserialize JSON activity to read the exported Postman collection and extract the required information, such as endpoints, request parameters, and expected response parameters.

  3. Send API Requests:
    Use UiPath’s HTTP Request activities or dedicated packages like “UiPath.Web.Activities” to send requests to the APIs using the extracted endpoints and parameters. You can set up headers, request methods, and request bodies as needed.

  4. Validate Responses:
    After sending the API requests, you’ll receive responses. Use the Deserialize JSON activity to parse the responses. Then, you can compare the actual response parameters with the expected parameters that you extracted earlier from Postman.

  5. Assertions and Validation:
    Utilize UiPath’s built-in validation activities or custom activities to compare the expected response parameters with the actual ones. Depending on your requirements, you might log discrepancies, raise exceptions, or trigger further actions.

Hope it helps!!

@ppr - thanks for your reply. Do you have any example xaml to share where I can see how to implement it? I mean how to fetch the response from collection.json and what data to be configured in httprequest activity.

If you can share any examples would be helpful. Thanks.

we can help on your specific json. Just share with us the collection.json what you have exported from postman

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.