How do i call the api using http to get info on 5 organisations?

How do i call the api to get info on 5 organisations?

I am using Power Automate and the http action to do the get call but how is the url structured?

I just want to query the api over http passing a number of ods codes to the api to get all the organisational data in the api - just cant seem to find any examples of how to do this over http…

This gets data for one organisation:

https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/0de

But what if i want to get data for this organisation and 4 others? Or 6 or 10? etc.

Thanks.

Hello steveh,

The Organisation Data Service - ORD API - NHS Digital enable access the full dataset of health and social care organisations in England and Wales, such as trusts or GP practices, using our Organisation Data Service (ODS) Organisation Reference Data (ORD) API. The above page includes endpoint URLs.

Have you reviewed the examples contained in: Organisation Data Service - FHIR API - NHS Digital?

The first thing to do is to check the API documentation for the NHS directory service. If the API supports retrieving multiple organizations in a single request, then you can use either of the following:- comma-separated values e.g: https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations/0de,0df,0dg,0dh,0di, Repeated parameter e.g: https://directory.spineservices.nhs.uk/ORD/2-0-0/organisations?code=0de&code=0df&code=0dg&code=0dh&code=0di, or Array notation
The exact format you decide to use depends on how the data in your API is structured. but looking at the data in your API, you can use the first method, if that doesn’t work then you might need to contact the API provider. To make an individual request for each organization, you can do the following: 1. create a loop by using apply on each action. 2. within the loop use HTTP action to make a get request to each individual ODS code 3. Store each request in an array or combine as needed.
I hope this is helpful
IF

1 Like

That is very helpful - the url examples are exactly what I was trying to find out - thanks!

Oh Perfect, I’m glad it works.