> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to accept an invitation

> How to accept meeting invitations with CRMScript

## Show follow-ups you are invited to

[GetMyAppointments()][2] will retrieve appointments for the currently signed-in user. To retrieve by associate ID, use [GetPersonDiary()][3] instead.

```crmscript! theme={null}
DateTime start;
DateTime end = start;
end.moveToQuarterEnd();

NSAppointmentAgent appointmentAgent;
NSAppointment[] appointmentList = appointmentAgent.GetMyAppointments(start, end, -1);

for (Integer i = 0; i < appointmentList.length(); i++) {
  NSAppointment a = appointmentList[i];
  Integer s = a.GetInvitationStatus();
  if (s >= 5 && s <= 10) {
    printLine(a.GetAppointmentId().toString() + "\t at " + a.GetStartDate().toString() + " - " + a.GetEndDate().toString());
  }
}
```

## Accept()

Calling `Accept()` is all it takes to turn [an invite][4] into an appointment in your diary. In real life, checking for conflicts 1st is recommended.

The 1st argument is the appointment ID. The 2nd is used with recurring meetings, and we'll leave it at 0 for now.

```crmscript theme={null}
NSAppointmentAgent appointmentAgent;
appointmentAgent.Accept(242,0);
```

## Make changes

Attendees may change only the priority, alarm, and completed fields. The rest is the responsibility of the meeting organizer. Updates are covered for [appointments][1] in general.

[1]: ./update-appointment

[2]: /en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentAgent#getmyappointmentsinteger

[3]: /en/automation/crmscript/reference/CRMScript.NetServer.NSAppointmentAgent#getpersondiaryintegerinteger

[4]: ../../../../diary/learn/invitation/index


## Related topics

- [How to accept an invitation (services)](/en/api/web-services/howto/diary/accept-invitation-services.md)
- [Accept invitations](/en/email/inbox/learn/invitations.md)
- [Accept and decline invitations](/en/mobile/diary/invitations.md)
- [How to create an invitation (services)](/en/api/web-services/howto/diary/create-invitation-services.md)
- [Add attendees and resources to follow-up](/en/diary/learn/invitation/add-attendee.md)
- [How to get a list of invitations (services)](/en/api/web-services/howto/diary/get-invitations-services.md)
