Skip to content

date_from and date_to request fails in API /rivers/river_id/drops request #55

Open
@dan-king

Description

@dan-king

The documentation at https://wiki.ushahidi.com/display/WIKI/SwiftRiver+API+River+Resources#SwiftRiverAPIRiverResources-GETrivers/:id/drops explains date_from and date_to parameters but doesn't describe the format.

The trends example uses the format YYYY-MM-DD but when I try this in the DROPS GET request I get the following error:

Fatal error: Uncaught exception 'Exception' with message 'An error occurred: array ( 'message' => 'Invalid parameter.', 'errors' => array ( 0 => array ( 'field' => 'date_from', 'code' => 'invalid', ), 1 => array ( 'field' => 'date_to', 'code' => 'invalid', ), ), )' in /opt/firsttosee/swift/api3.php:104 Stack trace: #0 /opt/firsttosee/swift/api3.php(120): API_Client->exec_api_request('/rivers/39/drop...', '', 'GET', Array) #1 {main} thrown in /opt/firsttosee/swift/api3.php on line 104

I get the same error when I try MM-DD-YYYY.

When I used RFC822 I get a different error:

$date_from = "Thu, 25 Jul 2013 15:12:33 -0700";
$date_to = "Thu, 15 Aug 2013 15:12:33 -0700";

Fatal error: Uncaught exception 'Exception' with message 'An error occurred: ''' in /opt/firsttosee/swift/api3.php:104 Stack trace: #0 /opt/firsttosee/swift/api3.php(120): API_Client->exec_api_request('/rivers/39/drop...', '', 'GET', Array) #1 {main} thrown in /opt/firsttosee/swift/api3.php on line 104

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions