You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2024-11-17 22:35:00

MichalW
Member
Registered: 2024-11-17
Posts: 3

API to create cost in Contracts?

Hi,

Any advise how to add Cost in Contracts by API call?


Cheers,

Michal

Offline

#2 2024-11-18 02:50:19

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,807
Website

Re: API to create cost in Contracts?

The same as adding any other item. The itemtype you are looking for is "ContractCost" (case sensitive).


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#3 2024-11-18 10:15:51

MichalW
Member
Registered: 2024-11-17
Posts: 3

Re: API to create cost in Contracts?

Thanks a lot smile
Is there a way to list all item categories/types?

Cheers:)


Michal

Offline

#4 2024-11-19 01:08:58

cconard96
Moderator
Registered: 2018-07-31
Posts: 2,807
Website

Re: API to create cost in Contracts?

Not really. You could get an idea of what is available by looking at the file names inside the "src" folder though.

The current API is extremely low-level.
We will be adding a second API in GLPI 11.0 which will be a lot more user-friendly.

A basic summary of the new API and the differences can be found here:
https://github.com/glpi-project/glpi/pull/12221


GLPI Collaborator and Plugin Developer.
My non-English comments are automated translations. Sorry for any confusion that causes.
Mes commentaires non anglais sont des traductions automatiques. Désolé pour toute confusion qui cause.
Mis comentarios que no están en inglés son traducciones automáticas. Perdón por cualquier confusión que cause.

Offline

#5 2024-11-21 10:41:31

MichalW
Member
Registered: 2024-11-17
Posts: 3

Re: API to create cost in Contracts?

Trick with "src" do the trick.
Looking forward for new API smile

Thanks a lot smile

M

Offline

Board footer

Powered by FluxBB