I have setup Google Books API, and setup the Data source to work correctly and validated.
Here is what I have done:
A Serverconnect connects to a server action query picking up titles and ISBN values from DB table.
For the API Data Source, I have then used a dynamic value from the Server Connect for the ISBN as a Query parameters for the API.
Setup a repeat region on the App side and set the expression source to the APIs Data.
I am able to connect and validate Google Books API - it does a search via ISBN and tested it with a static value for ISBN and worked. But when I switch over to have a dynamic value from the Serverconnect to plug into the API it does not work.
First off, you have used the client side API for google books which is fine, but I just want to make sure you are aware that the client side API is not designed for anything secure as such, so if Google gave you any API keys or your API provider has a quota assigned to you as a user based upon an account or something, then it would not really be secure and your keys could be exposed.
Anyway for the purposes of this, let’s assume that client side is fine, and its an API designed for public consumption. So I have a few questions as I have not used this particular api before myself.
Is you server connect returning a single record and passing that to the API, or is the server connect returning multiple results, i assume multiple results, but just want to be sure.
Is the api endpoint you are using able to receive a list of multiple ISBN numbers in one call, or do you have to give it a single number only, and repeat through to show all the single ones you want.
I assume it takes a single ISBN number each time, and you server action is retuning multiple numbers, therefore you would need to add a repeat after the server action and place your API action inside it, your repeat expression would be linked to the serverconnect1 component, and your API action would use the binding from inside the repeat.
It would be easier in this case if you posted a screenshot of the code view so we can see a little bit more detail too.
Noted about the API key security. Secured by domain restriction
Server returning multiple ISBNs and API receives single ISBN at a time
I have only setup a API Data source. You mentioned “API Action?”, is that different to the API Data Source? I don’t need to Post anything to the API, we are just gettin/retreiving Data from the API to display. I haven’t included the API Data Source inside the repeat region.
API Data Source should be fine, as you say you are not posting anything to the API you are just using sending it an ISBN and telling it to fetch its info from the API.
Are you currently having anything at all returned, like only getting your first record, or are you getting nothing back at all?
Basically from what I can see you have everything setup correct, the only problem is that you are sending the API all your ISBN numbers in one go and instead you need to give it one at a time, so you need to repeat through the records in your server action query and pass each one to the API Data Source.
To do this you would need a repeat after your server action, to figure out your repeat expression please send a screenshot of your server action.