Is it possible to call Postman from Excel VBA?

Hello,

I am wondering if Postman can be a solution for my problem.

I am looking for a solution to call and extract data from an api-server and generate a dataframe (in a user friendly way) once a minute. Next I would like run a script in Excel VBA which imports the data once a minute from Postman. Would this be possible?

(Alternatively I could call the api-server directly from Excel VBA, although it is very tough to process the received data into the correct data frame in Excel VBA.)

Thanks a lot!

Hi @marboe

You could probably achieve this using a webhook;

Hi w4dd325,

I have watched and read about webhooks. Is this not about reporting performance metrics of an api instead of transmitting data?

I am looking to do this steps if possible:

  1. call an api from Postman
  2. process the data from this api within Postman
  3. generate a table from this data in Postman
  4. read the table into Excel vba by calling Postman from Excel

Thanks!

A webhook would let you trigger an event inside Postman.

You would set up a webhook that does action and after setting it up you would have a URL you can use, in Excel you can then call that URL, which then triggers the event in Postman.

“Generating a table” might be a challenge as Postman is mainly used for sending requests and receiving a response.

Thanks @ w4dd325 . The solution I am looking for is to simplify the generation of the table (dataframe) from the data extracted from the api. This because this is quite tough from an Excel VBA array (which is the input received if I call the api directly in Excel VBA).

If generating a table in Postman is a challenge, I should probably look for an alternative solution. Maybe I should set up the api call with the contruction of the table in R or Python. Thanks a lot for your thoughts and time!

You could visualise the data in HTML within Postman but I don’t know if you could extract it as a table … maybe you can.

Here is an example;

var template = `
    <style type="text/css">
        .tftable {font-size:14px;color:#333333;width:100%;border-width: 1px;border-color: #87ceeb;border-collapse: collapse;}
        .tftable th {font-size:18px;background-color:#87ceeb;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;text-align:left;}
        .tftable tr {background-color:#ffffff;}
        .tftable td {font-size:14px;border-width: 1px;padding: 8px;border-style: solid;border-color: #87ceeb;}
        .tftable tr:hover {background-color:#e0ffff;}
    </style>
    
    <table class="tftable" border="1">
        <tr>
            <th>Name</th>
            <th>Email</th>
        </tr>
        
        {{#each response.data.contacts}}
            <tr id=row_{{@key}} onClick="handleClick(this.id)">
                <td id={{@key}}>{{name}}</td>
                <td>{{email}}</td>
            </tr>
        {{/each}}
    </table>
`;

pm.visualizer.set(template, {
    response: pm.response.json()
});

Output;

I expect the extra complexity from the HTML transformation will not make the whole route from api to Excel easier for me. Thanks!