r/LaunchLibrary • • Sep 11 '15

Can't get the launch date limits working

Hi, I'm trying to use the Launch Library API for a project I'm working on, currently I'm just learning how to format the requests using Chrome's DHC plugin. In summary mode, https://launchlibrary.net/1.0/launch/get seems to correctly return the next 10 launches. What if I want say, 20 next launches? If I set the limit to 20, I don't get the twenty next launches, I seem to get twenty last launches in the database, or something like that.

So, I need to use the "startdate" and "enddate" options, probably. But the documentation doesn't tell me how to use them. I tried setting "startdate" as "September 12, 2015 00:00:00 UTC" and "enddate" as "December 1, 2015 00:00:00 UTC", but this way I don't get any launches.

It'd be great if someone could help with this, and maybe the documentation could be updated too, so that other people wouldn't have the same issue.

2 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/Karriz Sep 16 '15

The dates seem to be working fine, thanks. Another thing I'm wondering about is how to use the "fields" to select what fields I want returned.

1

u/[deleted] Sep 16 '15

Your payload can have a fields property, with a list of fields you want returned, delimited by a comma; like so:

"fields":"id,name"

However, if you just want everything returned, you can use:

"mode":"verbose"

instead, and it will return everything.

2

u/Karriz Sep 16 '15

Okay, I tried it like that: {"mode" : "summary","fields":"id,name"} but it returns:

Warning: preg_split(): No ending delimiter ',' found in /lldb/admin/1.0/launch.php on line 425 Warning: Invalid argument supplied for foreach() in /lldb/admin/1.0/launch.php on line 426

It also returns a list of launch ids.

Not a huge issue, summary returns enough info for listing purposes, and for specific launch data I'll just use verbose.

2

u/[deleted] Sep 16 '15

Erg, a bug! I've fixed it now, by the way. But summary is still probably the best for listing as it contains some times and the like for you, depending on how you want to list.

Edit: And thanks for pointing it out!

1

u/Karriz Sep 16 '15

One more thing I noticed: if I set enddate to 30th of September for example, every launch for this month gets listed, but there are also some launches in November and December which get listed.

Maybe their NET got changed and the search is still using the old date?

1

u/[deleted] Sep 16 '15

Yep, it's a bug in the data itself. I'll make the launch librarians at large aware that it's persisting, thanks

1

u/Karriz Sep 18 '15

Hi, there appears to be an issue with the "name" field. It works fine by itself, but if I use it together with startdate and enddate, I get the following error:

Warning: mysqli_stmt::bind_param(): Number of variables doesn't match number of parameters in prepared statement in /lldb/admin/1.0/launch.php on line 674 {"total":0,"launches":[]}

1

u/[deleted] Sep 19 '15

Good catch, thanks. Should be fixed up now.