Giter Club home page Giter Club logo

Comments (2)

sect2k avatar sect2k commented on June 13, 2024 1

Passing parameters as JSON is something new to Twitter API, as it wasn't an option when birdy was written and it looks like we can't currently handle this use case.

I have a general idea how to handle this and should have a new version out in a day or two, time permitting.

Thanks for bringing this to my attention, haven't really worked with twitter API in a while, so this change went unnoticed.

from birdy.

sect2k avatar sect2k commented on June 13, 2024

@cherdt can you check out this branch (features/json-params) and let me know if it works. I don't have time to test this fully, but a quick test with requestb.in indicates that it should.

For API methods that require JSON params, the syntax is:

params = {
    "type": "message_create",
    "message_create":  {
        "target": {
            "recipient_id": "6039192"
        },
        "message_data": {
            "text": "hi there"
        }
    }
}

response = self.client.api.direct_messages.events.new.post(params)

You just pass a dict to post() and birdy will handle the rest.

If all is OK, i'll release a new version ASAP.

from birdy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.