Coder Social home page Coder Social logo

Comments (7)

Ptr314 avatar Ptr314 commented on August 12, 2024 2

Hi @akalex. But I tested it, and it worked. Just tested it again.

This code:

wh_filters = {
    'filter[from_ts]': '2023-12-04T12:00:00Z',
    'filter[to_ts]': '2023-12-04T16:00:00Z',
    'filter[status]': 'success',
}

for inv in zenpy.webhooks.invocations('01G00WWJ8VEMXSE31ENNJ6H2R9', **wh_filters):
    print(inv)

gives this debug output:

DEBUG:zenpy.lib.api:GET: https://pdi.zendesk.com/api/v2/webhooks/01G00WWJ8VEMXSE31ENNJ6H2R9/invocations?filter[status]=success&filter[to_ts]=2023-12-04T16:00:00Z&filter[from_ts]=2023-12-04T12:00:00Z - {'timeout': 60.0}
DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): pdi.zendesk.com:443
DEBUG:urllib3.connectionpool:https://pdi.zendesk.com:443 "GET /api/v2/webhooks/01G00WWJ8VEMXSE31ENNJ6H2R9/invocations?filter%5Bstatus%5D=success&filter%5Bto_ts%5D=2023-12-04T16:00:00Z&filter%5Bfrom_ts%5D=2023-12-04T12:00:00Z HTTP/1.1" 200 None
...
Invocation(id='01HGTF4QZGCE5E9VEPDWH2PFQK')
Invocation(id='01HGTF2X41Q0VS2HD5CR9TCA38')
Invocation(id='01HGTF26DHR5QZE0T0EEJ0AN4C')
Invocation(id='01HGTEMY6NS3FBW61XENWGJSXY')
Invocation(id='01HGTEDV4HBJFNWH54W7WDQ8KN')
DEBUG:zenpy.lib.generator:No more results available, stopping iteration

from zenpy.

Ptr314 avatar Ptr314 commented on August 12, 2024 1

Hi! Hope fixed it here: #606 if @cryptomail won't mind, I'll merge it a bit later

from zenpy.

akalex avatar akalex commented on August 12, 2024

Great. Thanks for your prompt response. Looking forward to getting it merged soon.

from zenpy.

Ptr314 avatar Ptr314 commented on August 12, 2024

@akalex please try a new release. Docs are here.

from zenpy.

akalex avatar akalex commented on August 12, 2024

Thanks, @Ptr314,
I am checking the new version and will come back to you shortly.

from zenpy.

akalex avatar akalex commented on August 12, 2024

Hey @Ptr314,
I realized it has no effect because **kwargs gets passed into the wrong method. This is how it is supposed to look I believe

    @extract_id(Webhook)
    def invocations(self, webhook, **kwargs):
        """
        Get a webhook invocations

        :param webhook: a webhook to get invocations
        """

        url = self._build_url(endpoint=self.endpoint.invocations(id=webhook))
        return self._get(url, **kwargs)

In that case, I should be able to pass query parameters as follows.

client.webhooks.invocations("webhook_id", params={"filter[status]": "failed"})

from zenpy.

akalex avatar akalex commented on August 12, 2024

Ok, I was wrong. It works.

from zenpy.

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.