Giter VIP home page Giter VIP logo

Comments (6)

alejcas avatar alejcas commented on August 17, 2024 1

I have just committed a fix (31f931d). I'll publish a new version on pypi in the following hours.

It now works as expected.

Thanks

from pyo365.

alejcas avatar alejcas commented on August 17, 2024

Can you please paste the function call you use to get the messages?

Are you using the query helper?

from pyo365.

ppascher avatar ppascher commented on August 17, 2024

I get the same error using the query helper (same for attribute 'created_date_time'):
query = query.on_attribute('received_date_time').greater(datetime(2018, 10, 29))

Order: None
Select: None
Client Error: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?%24filter=receivedDateTime+gt+%272018-10-28T23%3A00%3A00%2B00%3A00%27&%24top=25
Traceback (most recent call last):
  File "index.py", line 21, in <module>
    messages = inbox.get_messages(limit=25, query=query)
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/pyo365/mailbox.py", line 138, in get_messages
    response = self.con.get(url, params=params)
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/pyo365/connection.py", line 476, in get
    return self.oauth_request(url, 'get', params=params, **kwargs)
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/pyo365/connection.py", line 472, in oauth_request
    return self._internal_request(self.session, url, method, **kwargs)
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/pyo365/connection.py", line 453, in _internal_request
    raise e
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/pyo365/connection.py", line 426, in _internal_request
    response.raise_for_status()  # raise 4XX and 5XX error codes.
  File "/home/user/.virtualenv/research_rss/lib/python3.5/site-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?%24filter=receivedDateTime+gt+%272018-10-28T23%3A00%3A00%2B00%3A00%27&%24top=25```

from pyo365.

jessepink avatar jessepink commented on August 17, 2024

yes:
query = mailbox.new_query()

query = query.on_attribute('ReceivedDateTime').greater_equal(datetime(2018, 10, 29, 8, 0))

messages = mailbox.get_messages(query=query)

from pyo365.

jessepink avatar jessepink commented on August 17, 2024

That was quick, thanks!

from pyo365.

alejcas avatar alejcas commented on August 17, 2024

pip install --upgrade pyo365 should now upgrade to 0.1.3 with some bugs fixed.

See ya

from pyo365.

Related Issues (18)

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.