ushahidi / SwiftRiver-API

An API for external (third party) applications to post and consume data to/from SwiftRiver.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

New drop does not get added to specified rivers

dan-king opened this issue · comments

A new drop does not get submitted to specified rivers.

Suppose there exists Rivers with IDs of 1 and 15, and a Bucket of ID 252.

The following parameters in the POST request will add the newly created drop to bucket 262, but not to rivers 1 or 15

// List of IDs of the destination rivers
'rivers' => array(1,15),

// List of IDs of the destination buckets
'buckets' => array(274)

The channel_ids parameter must be specified. This is because we track where each drop came from i.e. a specific blog, twitter search term etc

We definitely have to revise some of the terminology to avoid confusion. E.g change channel to channel_type

Thoughts?

Channel_ids was specified. Here is the complete request:

$create_drops = array(array(

// Title of the drop
'title' => '#Everett #Earthquake Friday Test',

// Body of the drop
'content' => 'Earthquake in Everett, WA. Friday Test',

// Source channel e.g. rss, twitter, email, sms
'channel' => 'rss',

// Author of the drop
'source' =>  array(
    // Name of the source e.g. "Samuel L. Jackson"
    'name' => 'Dan King',

    // Username of the author at the source channel e.g. @bytebandit on Twitter
    'username' => '@viewpointpro',

    // URL to the avatar at the source channel
    'avatar' => '',

    // ID of the author at the source channel
    'origin_id' => 'http://www.viewpoint.pro'
),

// Date when the drop was published
'date_published' =>  'Tue, 7 Mar 2013 03:06:45 +0000',

// Source URL of the drop e.g. the URL of a news article
'original_url' => 'http://www.viewpoint.pro/Drop_A',

// ID of the drop at its source e.g. the ID of a tweet
'original_id' => 'http://www.viewpoint.pro/Drop_A',

// URL of the main image contained in the drop
'image' => '',

// Tags contained in the drop
'tags' => array(),

// Links contained (extracted) in the drop
'links' => array(),

// Media contained in the drop
'media' => array(),

// Places contained in the drop
'places' => array(
    array(
        'type' => 'City',
        'name' => 'Everett',
        'latitude' => '47.984655',
        'longitude' => '-122.214031'
    ),
    array(
        'type' => 'Country',
        'name' => 'USA',
        'latitude' => '48',
        'longitude' => '-122.2'
    ),
),

// Origin channel IDs of the drop
'channel_ids' => array(1),

// List of IDs of the destination rivers
'rivers' => array(1,15),

// List of IDs of the destination buckets
'buckets' => array(274),

));

$create_drops_response = $api_client->exec_api_request('/drops', json_encode($create_drops), "POST", $post_headers);

@dan-king Still experiencing a problem with this?

Closing. Re-open if still an issue