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 2016-12-28 18:19:21

tilb
Guest
From: CHOLET
Registered: 2008-05-07
Posts: 81
Website

Ajout d'un document à un ticket via l'API REST

Bonjour,
Ma demande concerne l'utilisation de l'API REST de la v9.1.1.
J'utilise déjà le plugin WebService sur la v0.85 sans soucis, mais je cherche à adapter mon script à cette nouvelle API en vue d'un passage en production sur la v9.1.1.
Je cherche à ajouter un document à un ticket au moment de la création de celui-ci. (cela fonctionnait avec le plugin Webservice..)
Je parviens à créer le ticket et l'associer à mon demandeur par une requête POST sur l'url "apirest.php//Ticket/", mais je ne trouve pas comment ajouté un document à ce ticket.
Si quelqu'un à une piste.
Par avance merci,
Florian


GLPI 9.1.2 et FusionInventory 9.1+1.0

Offline

#2 2017-01-06 20:01:13

tilb
Guest
From: CHOLET
Registered: 2008-05-07
Posts: 81
Website

Re: Ajout d'un document à un ticket via l'API REST

Bonjour à tous. Personne n'a de piste apparemment..  mad
bon bah je ne désespère pas, je continue à tester..
Merci


GLPI 9.1.2 et FusionInventory 9.1+1.0

Offline

#3 2017-01-31 09:05:44

Sebastien14
Guest
Registered: 2017-01-31
Posts: 2

Re: Ajout d'un document à un ticket via l'API REST

Bonjour,

Je n'ai pas de piste non plus concernant l'ajout de document par contre j'ai noté que tu avais réussi à associer ton ticket à un demandeur. La documentation n'est pas très détaillée sur le sujet, tu aurais quelques pistes à me donner ?

Merci.

Offline

#4 2017-01-31 10:44:49

tilb
Guest
From: CHOLET
Registered: 2008-05-07
Posts: 81
Website

Re: Ajout d'un document à un ticket via l'API REST

Bonjour,
Effectivement la doc n'est pas très claire à ce sujet et j'ai aussi pas mal tâtonné et fouiné dans le code de l'API pour trouver la propriété qu'il faut ajouter au paramètre "input":

  • _users_id_requester : doit contenir l'ID du demandeur

Bonne continuation,
Florian


GLPI 9.1.2 et FusionInventory 9.1+1.0

Offline

#5 2017-01-31 10:57:39

Sebastien14
Guest
Registered: 2017-01-31
Posts: 2

Re: Ajout d'un document à un ticket via l'API REST

Merci beaucoup pour l'information. Je commençais aussi à regarder du côté du code de l'API, tu m'as fait gagner du temps.

Bonne continuation à toi aussi.

Offline

#6 2017-01-31 12:09:04

tilb
Guest
From: CHOLET
Registered: 2008-05-07
Posts: 81
Website

Re: Ajout d'un document à un ticket via l'API REST

De rien, pour info en me repenchant sur mon PB d'ajout de document, je viens de trouver la solution.
Le scenario:

  • Création du ticket

  • Création du document avec numéro du ticket lié

Mon code;

    //création du ticket
    $options = array("input"=>array(
                    'requesttypes_id'=>7,  //webservices
                    '_users_id_requester'=>$user['id'],
                    'name'=>htmlentities($data['name']),
                    'content'=>htmlentities($data['content']),
                    'category'=>'1',
                    'items_id'=>array($itemtype=>array($item)),
                    'urgency'=>$data['urgency'],
                    'type'=>$data['type']));


    $ticket = sendRestRequest('Ticket', $options, 'POST');
    
    //On quitte si erreur de création
    if (!isset($ticket['id'])) return false;

    //ajout de la PJ si besoin
    if (isset($_FILES['attachment'])) {
        //déplacement de la PJ dans le dossier upload de glpi
        move_uploaded_file($_FILES['attachment']['tmp_name'], $glpi_upload_path.'/'.$_FILES['attachment']['name']);

        //création du document
        $options = array("input"=>array(
                        'name'=>$_FILES['attachment']['name'],
                        'upload_file'=>$_FILES['attachment']['name'],
                        'itemtype'=>'Ticket',
                        'items_id'=>$ticket['id']
                        ));

        $document = sendRestRequest('Document', $options, 'POST');

        //On quitte si erreur de création
        if (!isset($document['id'])) return false;
    }

Ca peut toujours servir !

Bon courage.

Florian


GLPI 9.1.2 et FusionInventory 9.1+1.0

Offline

#7 2017-09-07 11:24:56

Minou08
Guest
Registered: 2017-05-17
Posts: 26

Re: Ajout d'un document à un ticket via l'API REST

Merci Florian, mon problème d'accès au répertoire d'upload reste entier mais au moins j'ai pu voir la structure Document / Document_Item résultante.


GLPI 9.1.4 API REST/Client JavaEE/fusionInventory/Debian 8 Jessie

Offline

#8 2018-01-21 13:42:39

PeterWramy
Guest
From: Bahrain
Registered: 2018-01-21
Posts: 21

Re: Ajout d'un document à un ticket via l'API REST

Is updated by our users community with brand-new __ pics daily! VR __ is a fresh new immersive method to enjoy smut in your cell phone. 100 % safe, simple and private, OneTapPorn brings you full-length __ that's optimized for your iPhone, ipod itouch, iPad along with other well-known cellular devices. But it does not block __ content in sites like Amazing-glpi neither within the app nor within the internet browser. You may also block web sites based on 40+ filters like pornography, gambling, social media, assault, etc.

For $1 get join some HD __ on your cellular, however you will need subscribe to get all good content. This Flash-based web site has actually no-cost __ video clips that load quickly, with effortless search tags and sections and all choices in its drop-down selection. All of the VR __ that's now available is truly just the tip of just what the person enjoyment business wish to do. However everyone is convinced that this sort of erotica could keep audience's interest beyond the initial novelty.

If for some reason you do not desire to use a private browser choice or some of the internet sites in the list above, XNXX provides a tremendous mobile __ experience with a distinctly subtle name. Lazeeva App Store, therefore, contains mobile phone Apps that are both sexy within their content and positive inside their character. What makes VR __ therefore appealing, in its minimal scope, may be the prospective feeling of becoming in a film.

After a successful encryption, clean your __ record files by deleting the encrypted contents. Summary: uncover the top 100 no-cost __ programs, plus thousands more premium person applications and __ networks inside MiKandi Adult App Store. In the event that adult activity industry has its own method, Us americans will quickly get either no-cost __ on cellular phones - or at the very least some pictures of good-looking donkey in bikinis.

Filters an incredible number of Pornographic websites and keeps your Google lookups safe. One which just begin seeing __ in VR, you need to get the best applications. Whichever software or browser would you use, PornAway will prevent adult web pages every-where. Video gaming can be a larger force upon digital reality than __ could previously be, even inside the __ business.
Is updated by our people neighborhood with brand-new __ gifs everyday! Filters an incredible number of Pornographic web pages and keeps your Google searches safe. One which just begin seeing __ in VR, you ought to get the best applications. No matter which app or internet browser do you really make use of, PornAway will prevent adult web sites every-where. Gaming might be a larger power upon digital reality than __ could ever be, also inside the __ industry.

For $1 get sign up for some HD __ in your cellular, however you will need subscribe to get all of the good content. This Flash-based website has free __ videos that load rapidly, with effortless search tags and sections along with all choices in its drop-down selection. All of the VR __ which is available is actually simply the tip of exactly what the adult entertainment industry want to do. However everyone is convinced that this kind of erotica will keep viewer's interest beyond the original novelty.

To block the baddies - secured Surfer blocks all harmful sites, including pornography, so your family can see the online properly. However, PornAway is tailored to block __ internet sites rather than advertisements. Certain, just small amounts of individuals subscribe VR __ now, and several of the some ideas appear to be a fantasy. The nearest you'll receive is using the Samsung web browser for the Gear VR, which will cause you to some VR-friendly __ web pages, but that knowledge continues to be notably partial in lots of places.

We all know that __ on the web are definitely high in viruses, and __ in VR is only the same. We realize that VR Porno is a power for extensive adoption of virtual truth. VR __ movies from the likes of Naughty The united states are appropriate for Oculus Rift. Generally speaking a great application and obstructs most __ on devices. Free Cellphone Songs,Games, Softwares, Themes, Ringtones, Wallpapers & Videos.

There is lots taking place with __ in VR, and there is even more content being included on a daily basis. Now, although you can't end all of them from having a smartphone, but you are able to simply take specific measures to prevent __ on their Android smartphone. Dropdown menus make navigating towards favorite element of the site a breeze, whether which is MILF video clips or Pornhub's intimate health Center.


http://vankirk.us/__media__/js/netsoltr … rnmovs.net
http://vnelson.info/__media__/js/netsol … rnmovs.net
http://www.lnedulex.com/plus/guestbook. … ageno=1161
http://national-filter-sales.net/__medi … rnmovs.net
http://forum.aripk.ru/profile.php?id=39299
http://www.waitwaitdonttellmepodcast.ne … rnmovs.net
http://www.sweepsnow.com/__media__/js/n … rnmovs.net
http://www.alternativefuelsolutions.com … rnmovs.net
http://www.nwobserver.com/Redirect.asp? … nmovs.net/
http://www.2d-3d.ru/forum/away.php?s=ht … nmovs.net/
http://babalfeker.com/vb/member.php?u=430301
http://www.uaesigns-cg.com/__media__/js … et/latest/
http://ninjafighter.com/__media__/js/ne … rnmovs.net
http://www.bigapplebaby.com/__media__/j … rnmovs.net
http://nicokoenig.com/educationspace2/
http://www.wpp.com/annualreports/2007/e … nmovs.net/
http://www.venividi.ro/redirect.php?url=pornmovs.net
http://www.highspeedcspan.net/__media__ … rnmovs.net
http://gnitihw.com/__media__/js/netsolt … rnmovs.net
http://isvan-schick.com/__media__/js/ne … rnmovs.net
http://www.skypirate.com/__media__/js/n … rnmovs.net
http://www.bakkal.com/__media__/js/nets … et/latest/
http://infiniteapplication.com/__media_ … rnmovs.net
http://triumf-hohol.ru/member.php?u=31386
http://space.arttol.com/link.php?url=ht … nmovs.net/
http://inspectorsmall.com/__media__/js/ … rnmovs.net
http://www.hair-hat.com/__media__/js/ne … oogle_news
http://www.orphans.org/__media__/js/net … nmovs.net/
http://sbbelle.com/__media__/js/netsolt … rnmovs.net
http://www.electrohidraulica.co/index.p … ser/128948
http://ads.xtargeting.com/redir.php?url … nmovs.net/
http://jeffmarshall.com/__media__/js/ne … et/latest/
http://www.literacylaunch.net/__media__ … et/latest/
http://connect2athens.com/linkredir.cfm … et/latest/
http://www.smartmoneysolutions.com/__me … rnmovs.net
http://www.franville.com/__media__/js/n … rnmovs.net
http://www.atlanticjewel.com/__media__/ … rnmovs.net
http://www.fingrid.net/__media__/js/net … et/latest/
http://syste.com/__media__/js/netsoltra … rnmovs.net
http://june-taylor.com/__media__/js/net … et/latest/
http://www.rjrth.biz/__media__/js/netso … rnmovs.net
http://www.grand100.com.tw/redirect.php … nmovs.net/
http://www.google.iq/url?sa=t&rct=j&q=& … et/latest/
http://123cpu.com/__media__/js/netsoltr … et/latest/
http://www.squawkbox.com/__media__/js/n … et/latest/
http://www.pulseit.net/__media__/js/net … rnmovs.net
http://www.diciccoandsons.com/__media__ … rnmovs.net
http://www.al5hatib.com/vb/go.php?url=h … nmovs.net/
http://altpress.ru/bitrix/redirect.php? … rnmovs.net
http://www.tipodecambio.com/__media__/j … et/latest/
http://joclayorganics.com/__media__/js/ … rnmovs.net
http://www.zonums.com/epanet/test_db.php?a[]=<a href=http://pornmovs.net
http://www.cabinslakehartwell.com/__med … et/latest/
http://www.translight.net/__media__/js/ … rnmovs.net
http://ihatescioncarmax.org/__media__/j … et/latest/
http://www.elainemorgan.com/__media__/j … et/latest/
http://virginherbs.com/__media__/js/net … rnmovs.net
http://warp.ndl.go.jp/search/ArchiveSea … nmovs.net/
http://bookwiz.com/__media__/js/netsolt … rnmovs.net
http://kniha.vendula.eu/go.php?url=http://pornmovs.net/
http://www.4autocare.com/__media__/js/n … et/latest/
http://janter.co.nz/weather/checkserver.php?a[]=<a+href=http://pornmovs.net/latest/
http://ole.hindren.fi/guestbook/comment.php?gb_id=58832
http://alacarteradio.ca/user/ErmelindaP … ubscribers
http://www.ev-mart.com/__media__/js/net … et/latest/
http://www.alarab.com/redirect.php?url= … nmovs.net/
http://surfwearjapan.com/__media__/js/n … t/latest/&
http://data-search.org/__media__/js/net … rnmovs.net
http://www.pornstarvision.com/cgi-bin/u … et/latest/
http://www.affordablerepair.com/__media … rnmovs.net
http://www.olympicteam.com/__media__/js … et/latest/
http://imaxxwealth.org/__media__/js/net … rnmovs.net
http://www.chelseachris.com/UserProfile … fault.aspx
http://www.gustavolima.com/__media__/js … rnmovs.net
http://westfraserusa.com/__media__/js/n … rnmovs.net
http://www.dushenko.ru/bitrix/rk.php?go … et/latest/
http://www.cute-nymphets.net/cgi-bin/ou … et/latest/
http://atlansys.ru/forum/user_post.php? … &PAGEN_1=3
http://emmanuellechirqui.tv/out.php?url … rnmovs.net
http://yoursitevalue.info/pornmovs.net/
http://www.seniormate.com/__media__/js/ … rnmovs.net
http://www.nationalb2bcentre.com/__medi … rnmovs.net
http://www.capitelli.com/__media__/js/n … rnmovs.net
http://nfader.su/forum/memberlist.php?m … tart=51950
http://knex2us.net/__media__/js/netsolt … rnmovs.net
http://www.mianchidinuan.com/home.php?mod=space&uid=400
http://lsv-muehlhausen.net/gb/index.php … page=24623
http://www.canesauce.com/__media__/js/n … rnmovs.net
http://hoanganentec.vn/index.php?option … &id=105213
http://www.executivelevelselling.com/__ … et/latest/
http://7billion.com/__media__/js/netsol … rnmovs.net
http://www.oxforduniversitypress.net/__ … rnmovs.net
http://is4ie.com/__media__/js/netsoltra … rnmovs.net
http://northernplainsinvestment.com/__m … rnmovs.net
http://www.tampabayfederalcreditunion.n … rnmovs.net
http://www.meridian-outlet.ru/go.php?ur … nmovs.net/
http://www.piedmonturologypc.com/__medi … rnmovs.net
http://wlwt.info/__media__/js/netsoltra … rnmovs.net
http://www.womencando.org/__media__/js/ … rnmovs.net
http://practiced.com/__media__/js/netso … rnmovs.net
http://www.katakura.net/xoops/html/modu … nmovs.net/
http://www.sisterweb.com/__media__/js/n … rnmovs.net
http://dearchild.com/__media__/js/netso … rnmovs.net
http://domengplus.com/__media__/js/nets … rnmovs.net
http://divorcelawyerlist.us/__media__/j … et&popup=1
http://creative.su/lib/redirect/?url=ht … nmovs.net/
http://www.e-aacpmas.com/__media__/js/n … rnmovs.net
http://www.frontrunnerzmotorcycleclub.c … et/latest/
http://webean2.net/www/bhsfb/sponsors/r … nmovs.net/
http://www.longcenter.org/__media__/js/ … rnmovs.net
http://www.lighthousemovies.com/cgi-bin … et/latest/
http://watchfreetv.com/__media__/js/net … et/latest/
http://www.floc-clear.com/__media__/js/ … j9t6at07h7
http://www.worldwidewords.com/__media__ … et/latest/
http://www.smartspecs.com/__media__/js/ … rnmovs.net
http://www.gamelearning.com/__media__/j … rnmovs.net
http://www.visafittan.org/ept/out.php?f … nmovs.net/
http://www.jcomputer.biz/__media__/js/n … rnmovs.net
http://baincapital.info/__media__/js/ne … et/latest/
http://westakfish.com/__media__/js/nets … ovs.net&p=
http://www.pest-manager-report.net/__me … et/latest/
http://seaforum.aqualogo.ru/go/?http://pornmovs.net/
http://jcsmall.com/__media__/js/netsolt … rnmovs.net
http://club4you.pl/2017/08/07/page/8/
http://animalfarmfoundation.net/__media … rnmovs.net
http://digitaltouchup.com/__media__/js/ … rnmovs.net
http://compunetixinc.com/__media__/js/n … rnmovs.net
http://188.213.21.34/index.php?option=c … tart=53780
http://realix.ru/wp-content/plugins/wp- … rnmovs.net
http://www.kikitchew.com/__media__/js/n … nmovs.net/
http://galacticrepublic.net/__media__/j … rnmovs.net
http://www.celebrity-tours.com/__media_ … rnmovs.net
http://weather-forensics.com/__media__/ … rnmovs.net
http://linkto.cf/pmja
http://www.agromrezanvo.org/realizovani-projekti-2/
http://nmkit.com/__media__/js/netsoltra … et/latest/
http://www.der-baxxter.de/index.php?sit … spage=1415
https://intranet.umn.org.np/sv/web/ictb … rnmovs.net
http://www.wl-zg.com/home.php?mod=space&uid=383552
http://www.skwigly.co.uk/mighty-hercules/
http://www.rmnrelax.de/out.php?site=htt … et/latest/
http://delicedefrance.com/__media__/js/ … rnmovs.net
http://www.halifaxforum.ca/Redirect.asp … et/latest/
http://bitcoingist.com/profile.php?id=147845
http://www.cheapestadultscripts.com/php … nmovs.net/
http://uspsofficesupplies.com/__media__ … rnmovs.net
http://souz-eco.ru/index.php?option=com … r&id=52923
http://www.saradial.com/__media__/js/ne … rnmovs.net
http://www.z.club-z.ro/forum/profile.ph … e&u=141132
http://www.wuhanbjgs.com/plus/guestbook … ageno=2563

Offline

Board footer

Powered by FluxBB