prowdsponsor / ig

Bindings to Instagram's API
Other
11 stars 14 forks source link

Update type for Subscription supports new fields #19

Open ugnom opened 9 years ago

ugnom commented 9 years ago

Hi,

As I have tested some cases for data feed coming from Instagram by registering the Subscription of the real time updates, I see some new fields are added to the in coming structure.

I see ig package supports this feed by "Update" type, but this additional fields do not seem to be supported by this type.

Now update feed coming like this, that the ones under "data" field looks new ones.

[
{
    "changed_aspect": "media",
    "object": "user",
    "object_id": "2157425226",
    "time": 1441018341,
    "subscription_id": 19731857,
    "data":
    {
        "media_id": "1063661397067665037_2157425226"
    }
}
]

I do not see this is properly documented in the Instagram API document, but do you have any plans to support this in near future?

Thank you,

meteficha commented 9 years ago

Hmm, does that fact that there isn't documentation about that field mean that they're lazy, or that this is an unsupported API?

ugnom commented 9 years ago

I suppose they are simply a bit lazy. The sample is in "Receiving Updates" section in the following URL. It does not include "data" field in there. I could not find the comments for this field in other places either as long as I have checked. https://instagram.com/developer/realtime/

meteficha commented 9 years ago

@cdepillabout What's your opinion about including this field to ig?

cdepillabout commented 9 years ago

Hmm, I checked out the Ruby client and Python client to see how they are handling subscriptions.

The Python client doesn't seem like it has any specific support for handling the data in a subscription callback.

The Ruby client looks like it provides some helper methods for handling callbacks, but it doesn't particularly help you out with the data in a subscription callback.

However, it does have have a test that deals with subscription callback. Here is the data they are using in their test: https://github.com/Instagram/instagram-ruby-gem/blob/master/spec/fixtures/subscription_payload.json

It doesn't look like they are using the extra data field in their test.

I'll email instragram and try to find out what's up.