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

Prochaines sessions de formation

Les prochaines formations et démonstrations sont ouvertes, inscrivez-vous rapidement !

 

Démonstration de ProjeQtOr

(gratuit, sur inscription)

Mardi 23 avril (10h30-12h)

Jeudi 16 mai (16h-17h30)

Jeudi 13 juin (10h30-12h)

 
 

Planifiez avec ProjeQtOr

3 et 4 avril (9h - 12h30)

 
 

Administrez avec ProjeQtOr

10 et 11 avril (9h - 12h30)

 

 

 
 

[SOLVED] API documentations and samples

More
08 Fév 2022 11:59 - 08 Fév 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 Fév 2022 12:00 by MagicBuzz.

Please Connexion or Create an account to join the conversation.

More
12 Fév 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 Connexion 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 Connexion 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 Connexion 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 Connexion or Create an account to join the conversation.

Moderators: babynusprotion
Time to create page: 0.040 seconds

Paramétrages de cookies

×

Cookies fonctionnels

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

Veuillez vous connecter pour voir vos activités!

Autres cookies

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