Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Development
  1. OpenProject
  2. Forums
  3. Development
  4. time_entries API do not work with eprops

time_entries API do not work with eprops

Added by Frédéric MAZUR about 2 years ago

Hello,

I am trying to retrieve some data with the API, and especially the time entries.

I have coded this in python, and I have some difficulties. When I get time entries with a filter, the filter don't work if I use the "eprops" method, while it works with the "filter" method .

Here are my two urls : 

  • http://xxx.com:8080/api/v3/time_entries?eprops=eJyrVkrLzClJLSpWslJQiq6OUSouSM0ric/PiwEKALn5BalFiSX5RSBujFJJjJIOkCpLzClNLQYJRcfW1sYq1QIASHwXVA%3D%3D
  • http://xxx.com:8080/api/v3/time_entries?filters=%5B%7B%22spent_on%22%3A%20%7B%22operator%22%3A%20%22t%22%2C%20%22values%22%3A%20%5B%5D%7D%7D%5D

The first don't work, while the second works well. The first always return all the time entries as if it was not filtered.

The decoding eprops can be done with this python code : 

import json
import urllib 
import base64
import zlib

def eprops_to_dict( string ):
    result = ""
    
    unquoted = urllib.parse.unquote(string)
    decoded = base64.b64decode(unquoted)
    decompressed = zlib.decompress( decoded)
    result = decompressed.decode("utf-8")   
    

    return result

Result is : 

{"filters": "[{\"spent_on\": {\"operator\": \"t\", \"values\": []}}]"}

If I use the same method for another API query, for example work_packages, it works well. I don't understand what happens ?

Thanks a lot for your help.

F. MAZUR.


Loading...