Exemples d'API
Créez des exemples
Exemples de requêtes POST pour les projets, les tâches, le temps, les applications de flux de travail, les mises à jour et les dépenses.
Projet
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"manager":"Tony Stark","name":"API Project","plannedStart":"2019-08-29","state":"77306","type":"48673"}' \ 'https://app.celoxis.com/psa/api/v2/projects'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-project.json \ 'https://app.celoxis.com/psa/api/v2/projects'Données
{ name: "Projet via API", description: "Détails relatifs au projet", code: "apiproject", creator: "Tony Stark", plannedStart: "2019-09-01", deadline: "2019-09-30", manager: "Tony Stark", priority: "3", state: "77307", type: "Implémentation", workspace: "Default", budget: "500000", billingType: "1", clients: "Acme International", fixedPrice: "44500", alignment: "75", benefit: "25", risk: "3", }Temps enregistré sur une tâche
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"date":"2019-07-15","hours":"8","timeCode":"109369", "task":"15984213","isBillable":"f"}' \ 'https://app.celoxis.com/psa/api/v2/timeEntries'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-time.json \ 'https://app.celoxis.com/psa/api/v2/timeEntries'Données
{ task: "15984213", date: "2019-09-04", hours: "5.2", timeCode: "109369", isBillable: "t", billRate: "100", comments: "saisie de temps soumise via l'API", isCostable: "t", costRate: "50", creator: "Tony Stark", state: "1", }Temps hors projet
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"date":"2019-08-29","hours":"8","timeCode":"109372"}' \ 'https://app.celoxis.com/psa/api/v2/timeEntries'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-time-non-project.json \ 'https://app.celoxis.com/psa/api/v2/timeEntries'Données
{ date: "2019-09-04", hours: "4", timeCode: "109371", comments: "entrée de temps hors projet soumise via l'API", isCostable: "t", costRate: "50", creator: "Tony Stark", state: "1", }Temps enregistré sur une application
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"process":"706315","date":"2019-08-29","hours":"8","timeCode":"109372"}' \ 'https://app.celoxis.com/psa/api/v2/timeEntries'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-time-non-project.json \ 'https://app.celoxis.com/psa/api/v2/timeEntries'Données
{ process: "706315", date: "2019-09-10", hours: "5.2", timeCode: "default", comments: "entrée de temps soumise via l'API", creator: "Tony Stark", state: "1", }Application
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"app":"110147","description":"élément d'application via l'API v2","name":"application API v2","project":"Projet 1"}' \ 'https://app.celoxis.com/psa/api/v2/apps'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-app.json \ 'https://app.celoxis.com/psa/api/v2/apps'Données
{ name: "App via API", app: "110147", description: "Détails relatifs à l'application", creator: "Tony Stark", priority: "3", risk: "3", custom_bug_affects_version: "1.0", custom_status_budget: "Green", custom_bug_type: "Improvement", custom_multi_select: "one", custom_bug_component: "Component 1", custom_status_date: "2019-08-30", dueDate: "2019-09-05", custom_bug_fix_version: "2.0", workspace: "Default", custom_bug_severity: "Major", project: "Project via API", assignee: "Mark", }Mise à jour des tâches
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"task":"API Task","percentComplete":"50"}' \ 'https://app.celoxis.com/psa/api/v2/taskUpdates'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d @create-task-update.json \ 'https://app.celoxis.com/psa/api/v2/taskUpdates'Données
{ task: "Tâche API", percentComplete: "20", actualStart: "2019-09-04", comments: "Mise à jour de la tâche créée via l'API", creator: "Peter Parker", }Tâche
En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d @create-task.json \ 'https://app.celoxis.com/psa/api/v2/tasks'Données
{ name: "Tâche API", project: "Projet API", description: "Description de la tâche ajoutée", plannedStart: "2019-09-05", plannedFinish: "2019-09-16", actualStart: "2019-09-05", plannedEffort: "64", scheduleType: "FIXED_WORK", duration: "8d", constraintType: "SNLT", constraintDate: "2019-09-05", priority: "NORMAL", resources: "Executive[20%], Peter Parker", externalKey: "AF-123", custom_kanban_state: "En cours", custom_single_select: "two", custom_text: "Champ personnalisé de texte sur une seule ligne", billingType: "2", creator: "Tony Stark", }Frais
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d '{"name": "Déjeuner-réunion avec les clients", "task" : "176543", "items" : [{"description" : "Déjeuner avec le client XYZ", "date" : "2019-08-12", "expenseCode" : "Repas", "amount" : "5000"}, {"description" : "Déjeuner avec le client ABC", "date" : "2019-08-13", "expenseCode" : "Repas", "amount" : "3500"}]}' \ 'https://app.celoxis.com/psa/api/v2/expenses'En utilisant un fichier :
curl -g -X POST \ -H 'Content-Type: application/json' \ -H 'Authorization: bearer YourTokenHere' \ -d@create-expense.json \ 'https://app.celoxis.com/psa/api/v2/expenses'Données
{ name: "Réunion client", task: "176543", isBillable: false, isCostable: true, items: [ { description: "Déjeuner avec Peter", date: "2019-08-12", expenseCode: "Repas", amount: 5000, reimbursable: "true", }, { description: "Déjeuner avec Mary", date: "2019-08-13", expenseCode: "Repas", amount: 3500.4, }, ], }