API agendaevents

I can’t find any documentation about the API. It is a great tool, I was able to add project, categories or even proposals (with lines). However, I am not able to add an agenda events. Does anyone has a POST example ?

Are you using dolibarr 5+ ? You should have an entry agendaevents

1 Like

I’m using Dolibarr 5.0.1.

Adding an event manually into Dolibarr interface is possible.
Get the list of events (GET /agendaevents) or a specific event (GET /agendaevents) is working perfectly well.

However, when I try to add an event with the API (POST /agendaevents) it’s not working. For example :

{
“table_rowid”: “id”,
“type_id”: “1”,
“type_code”: “AC_TEL”,
“type”: “Appel téléphonique”,
“code”: “AC_TEL”,
“label”: “Label of call”,
“datec”: 1493571243,
“datem”: 1493571243,
“authorid”: “1”,
“datep”: 1493571120,
“datef”: 1493571180,
“durationp”: -1,
“fulldayevent”: “0”,
“punctual”: “1”,
“percentage”: “100”,
“location”: “”,
“transparency”: “1”,
“priority”: “0”,
“userassigned”: [],
“userownerid”: “1”,
“socid”: “37515”,
“actions”: [],
“array_options”: [],
“linkedObjectsIds”: [],
“context”: [],
“note”: “La description de l’appel”
}

I created this example with an existing event thanks to (GET /agendaevents). Unfortunalty, Response Body is always “no content” and Response Code is always 500. I never received another error code with agendaevents.

Other action are working, for example I am able to create a project :

{
‘description’: ‘description du projet’,
‘titre’: ‘titre du projet’,
‘title’: ‘titre du projet’,
‘date_start’: 1202162400,
‘date_end’: 1206914400,
‘date_close’: 1206914400,
‘socid’: ‘35830’,
‘user_author_id’: 3,
‘public’: 1,
‘budget_amount’: ‘2000’,
‘statut’: 2,
‘opp_status’: 6.0,
‘opp_percent’: 100.0,
‘datec’: 1206914400,
‘date_c’: 1206914400,
‘ref’: ‘PJ0802-0231’,
‘note_public’: ‘’,
‘note_private’: ‘’,
‘opp_amount’: ‘2000’
}

Do you have a working example of POST /agendaevents ? or may be you know where I can find one.

It was a bug. It is now solved. https://github.com/Dolibarr/dolibarr/pull/6883

hello, can you explain to me how you did it, i don’t get it


we put the code here ?