Rescue-Groups API and Laravel
Hi guys. I am new to Laravel but I have worked through the Laravel tutorials and I am starting my first build for a non-profit for whom I serve on the board. I am not new to programming but somewhat new to Laravel.
I am working on an animal medical database that will allow my Dog Rescue to track medical procedures (dentals, Spay and Neuters, eye surgeries) and medications for the dogs in the application. My goal is to feed data from rescue groups (an online animal management database) API into my application so then we can augment the functionality and make it responsive.
Ideally, I will have some sort of process that will pull down any changes from Rescue Groups since the last poll and and upsert them into my application. On the application side, this data is read only and will always be managed from Rescue Groups. I have modified their sample php application to pull my data but I am trying to figure out the best way to manage this in Laravel. The code using curl to make the api requests.
When I log into Rescue Groups, I get an API key that should use going forward so I don't have to keep logging in each time.
I have a couple of questions and hopefully you guys will point me in the right direction.
-
Since the default API uses curl, could I use something like Guzzle to handle my API requests?
-
When I login to rescuegroups.org with the api, it returns a token than I can use going forward. Does Laravel have a facility to manage this? I suspect this token will expire after some time and I will have to get the application to login again.
-
Finally, is there a way in Laravel to manage the API? Should I use a Model or an Interface? Potentially, I could just use a scheduled job.
Thank-you in advance for any input.
Links of note:
Sample API code in PHP: https://userguide.rescuegroups.org/display/APIDG/Full+working+PHP+example
Rescue Groups: (I am using v2 since v5 is not released yet). https://rescuegroups.org/services/adoptable-pet-data-http-json-api/
Please or to participate in this conversation.