ballasterlingus's avatar

Some help required for Guzzle HTTP Request and seeding to database

Hi all, I am in a bit of a struggle here. I am trying to use Guzzle HTTP to login to an external API, get a cookie for session handling, download the data (JSON format) and then seed to database. I will just quote the tutorial from the website (space-track.org):

Use encrypted cookies for session handling. Login by sending a HTTP POST request ('identity=your_username&password=your_password') to: https://www.space-track.org/ajaxauth/login.

After that, I guess you just send your request, which for example would be: https://www.space-track.org/basicspacedata/query/class/boxscore.

I would then suppose you either save the data to a JSON file, or migrate it directly to my database. The other thing is that I would want, is to setup a Cronjob, that repeats the process once a day as sometimes more data can be added or removed.

So far I have followed a few simple tutorials on Guzzle and I have imported JSON data to my database.

Basically, what I want to create is this: Login to API -> Pull data from the necessary JSON file -> either download or either send the data to my database -> update data at intervals (repeat process)

Any help/guides would help. Thanks!

0 likes
0 replies

Please or to participate in this conversation.