Probleme beim Projekt anlegen und aktualisieren

Ich implementiere eine Synchronisation von unserem ERP in Richtung awork.

Unter anderen möchte ich Projekte anlegen und aktualisieren > Endpoint: https://api.awork.com/api/v1/projects
(ich synce nur die folgenden Attribute: name, timeBudget, companyId und beim POST auch noch projectTemplateId.)

2 Punkte sind mir aufgefallen:

  • Image von der Projektvorlage wird nicht für neue Projekte beim POST übernommen.

  • dueDate wird beim PUT (Aktualisieren des Projekts) überschrieben, obwohl im Call nicht mitgegeben (z.B. bei description funktioniert das korrekt).

Bitte um Prüfung!
Dank & Gruß, René Heidenreich

Hi @ReneHeidenreich and welcome to the developer forum. Thanks for reporting this.

  • We are discussing internally whether the image of the project template should be taken over as the project image.
  • Do you have a trace Id of the response in this case? This would help me understand what you’re sending. In PUT requests, all properties that are not set will be reset, which is expected. If you want to keep the dueDate as it is, you would need to send it in the request as well.

Hope this helps.

Sebastian

Hi @Sebastian,

according to the duedate-issue.
description will be kept and duedate will be reset (both values are not in my json-request).

duedate is not in my ERP - so I don’t want to sync it.

if nesscesary I could implement a GET and PUT. the better/cleaner solution would be - API ignores null-fields.

best regards, rené

Hi @ReneHeidenreich, a PUT request is expected to overwrite the existing resource and therefore set fields to null that are not present. What you would need is a PATCH request, which the awork API does not support unfortunately. So the expected behavior in this case is to fetch the entity via GET , update the properties you want to change and send it to the API via PUT. The fact that the description doesn’t get updated might be a bug, we will investigate, thanks for letting us know.