View ProjeQtOr On SourceForge.net
ProjeQtOr - Project Management Tool
Support us on Capterra
OIN - Open Invention Network
ProjeQtOr free project management software - [SOLVED] API documentations and samples - ProjeQtOr
 
 

[SOLVED] API documentations and samples

More
08 Feb 2022 11:59 - 08 Feb 2022 12:00 #1 by MagicBuzz
Hello,

I'm trying to write an interface between ProjeQtOr and our leaves period tool.

I'm facing two main problems:
- First one, in the API documentation says we can CRUD any "object class". But it doesn't provide the list of object classes. As a result, I'm blindly trying different words, hoping to find the correct class name. Is there a readable list of all classes names ? Or some "dictionary" API that could give me this list ?

- Second one, Leaves are managed in ProjeQtOr like work on activities on administrative projects. This way it looks like I can find the data I need. But I notice a "leaveId" property on the "work" object (but it's zero).Isn't there a more specialized object for leaves ? My need would be to find all leaves for a resourceId between to dates. What it the use of the "leaveId" in the "Work" object and why is it zero at my side?
Last edit: 08 Feb 2022 12:00 by MagicBuzz.

Please Log in or Create an account to join the conversation.

More
12 Feb 2022 16:41 #2 by babynus

Is there a readable list of all classes names ? 

You'll get the list in table "importable"

Isn't there a more specialized object for leaves ?

It is LeavePeriod.
But in fact, if you don't use internal validation process for leaves, you just have to record real work on an administrative project you create on your onw, an activity on this project. You don't need to use ProjeQtOr Leave System.

Babynus
Administrator of ProjeQtOr web site
The following user(s) said Thank You: MagicBuzz

Please Log in or Create an account to join the conversation.

More
10 Mar 2022 23:19 - 10 Mar 2022 23:26 #3 by MagicBuzz
Hello,

Thank you for your answer.

I followed your suggestion and I'm now facing a strange issue with the REST API.

I'm creating absences using this by sending POST requests like this to the Work API :
{"idResource":"31", "idProject":"44", "refId":"521", "work":"7.0", "workDate":"2021-05-24", "refType": "Activity"}

Some absences are created fine, but some other fails with this error :

{"identifier":"id", "items":[{"apiResult":"KO", "apiResultMessage":"ERROR either idAssignment or idWorkElement is mandatory", "idLeave":"", "inputUser":"", "inputDateTime":"", "manual":"", "id":"", "idResource":"", "nameResource":"", "idProject":"", "nameProject":"", "refType":"", "refId":"", "idAssignment":"", "work":"", "workDate":"", "cost":""}] }

The error message is not very revelant as the working requests doesn't contains idAssignment or idWorkElement either...

I tried to find differences between my working and not working users/ressources but can't find what is wrong...
I also found that for a same user some work can be created on some activities and not on others.
I noticed that all working users are assigned to the leaves activities even when not time was created for the user and activity. What creates those assignments ?
Last edit: 10 Mar 2022 23:26 by MagicBuzz.

Please Log in or Create an account to join the conversation.

More
11 Mar 2022 08:21 #4 by babynus
Hi,

in your case, work for Leave, idAssignment is required.
It is the id of the Assignment of the Resource to the Leave Activity.
If you don't provide it, it will be searched from refType/refId (to find the Activity) and idResource (to find the Assignement of the resource on the Activity).
If search finds one and only one item, idAssignment is set when wtoring Work.
So in your case, Work for Resource that have an Assignement on the Leave Activity will work.
But Leave system (without the API) do not require an Assignment, it will create one if needed.
It is this step that is missing in your case when it does not work.

So, to summarize :
  • if the Resource already entered a leave period through the interface on the Leave Type (the Activity), it will work through the API.
  • if the Resource did not enter a leave period through the interface on the Leave Type (the Activity), it will not work through the API unless you create the Assignment through the API.

Babynus
Administrator of ProjeQtOr web site

Please Log in or Create an account to join the conversation.

More
11 Mar 2022 09:12 - 11 Mar 2022 10:44 #5 by MagicBuzz
Hello,

Thank you for your very quick answer, as usual.

I created the leaves project and activities just before running the program.
So there is something that actually created some assignements for me, pretty strange...

Anyway, I will upgrade my code to create assignment before work as needed.
Last edit: 11 Mar 2022 10:44 by MagicBuzz.

Please Log in or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.036 seconds

Cookies settings

×

Functional Cookies

Ce site utilise des cookies pour assurer son bon fonctionnement et ne peuvent pas être désactivés de nos systèmes. Nous ne les utilisons pas à des fins publicitaires. Si ces cookies sont bloqués, certaines parties du site ne pourront pas fonctionner.

Session

Please login to see yours activities!

Other cookies

Ce site web utilise un certain nombre de cookies pour gérer, par exemple, les sessions utilisateurs.