Git Product home page Git Product logo

Comments (7)

dnl-blkv avatar dnl-blkv commented on May 24, 2024 1

@OGKevin @CharlPels
I believe it should have been:

from bunq.sdk.model.generated.endpoint import UserPerson
from bunq.sdk.model.generated.object_ import NotificationFilter
from bunq.sdk.context import ApiContext

ctx = ApiContext.restore()
USER_ID = 400

filters = [NotificationFilter('URL', 'myurl.com', 'BILLING')]

request_body = {
    UserPerson.FIELD_NOTIFICATION_FILTERS: filters
}

UserPerson.update(ctx, request_body, USER_ID)

Source: https://doc.bunq.com/api/1/call/user-person/method/put

@CharlPels please let me know if this doesn't work. I did not run the code myself yet - will do so as the first thing tomorrow, if it still doesn't work :)

from sdk_python.

OGKevin avatar OGKevin commented on May 24, 2024

Hey @CharlPels

Here an example to set a call back to UserPerson 👍

from bunq.sdk.model.generated.endpoint import UserPerson
from bunq.sdk.model.generated.object_ import NotificationFilter
from bunq.sdk.context import ApiContext

ctx = ApiContext.restore()
USER_ID = 400

filter_ = NotificationFilter('URL', 'myurl.com', 'BILLING')

request_body = {
    UserPerson.FIELD_NOTIFICATION_FILTERS: filter_
}

UserPerson.update(ctx, request_body, USER_ID)

Let me know if this is what you were looking for 😄.

from sdk_python.

CharlPels avatar CharlPels commented on May 24, 2024

No luck, get an error
bunq.sdk.exception.ApiException: HTTP Response Code: 400
Invalid type for field "notification_filters" (expected ARRAY containing STRUCT).

filter i use is
filter_ = NotificationFilter('URL', 'https://bunqsample.azurewebsites.net/api1', 'BILLING')

from sdk_python.

OGKevin avatar OGKevin commented on May 24, 2024

@CharlPels 😁 I forgot to array it indeed @dnl-blkv example looks to be the correct example 😉

from sdk_python.

CharlPels avatar CharlPels commented on May 24, 2024

It is working now, and now how to remove a callback endpoint would also be nice to know :-)

from sdk_python.

OGKevin avatar OGKevin commented on May 24, 2024

@CharlPels To remove a callback you can do this:

filters = [NotificationFilter('PUSH', None, 'BILLING')]

You can read more about this here: https://together.bunq.com/topic/unregister-callback-webhook#comment-7926

UserPerson.update(ctx, request_body, USER_ID)

Will return an id as shown here: https://doc.bunq.com/api/1/call/user-company/method/put

If you get this id, means that the request came back with status 200 (which means everything went successful)

Afterwards depending on the category you've chosen, which are listed here: https://doc.bunq.com/api/1/page/callbacks

You will get a POST request to the url you defined.

from sdk_python.

OGKevin avatar OGKevin commented on May 24, 2024

Closing the issue, feel free to comment afterwards.

from sdk_python.

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.