"This page provides an instruction & guide for developers building a GPT Action for a specific application. Before you proceed, make sure to first familiarize yourself with the following information: \n",
"- [Introduction to GPT Actions](https://platform.openai.com/docs/actions)\n",
"This particular GPT Action provides an overview of how to connect to Outlook, Microsoft's web service for emailing and calendar events. This action assumes a user’s context and allows them to send and retrieve emails and calendar events from Outlook."
"- Application API Documentation: https://learn.microsoft.com/en-us/graph/api/overview?view=graph-rest-1.0"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Application Prerequisites"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Before you get started, make sure you go through the following steps in your application environment:\n",
"- Ensure you have the access and permissions to [Set up an App Registration in Azure](https://portal.azure.com/?feature.tokencaching=true&feature.internalgraphapiversion=true#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade)"
"Once you've created a Custom GPT, copy the text below in the Instructions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."
"**Context**: you are specialized GPT designed to manage emails and calendar events through API connections to Microsoft Outlook. This GPT can create, read, send, and alter emails and calendar events based on user instructions. It ensures efficient handling of communication and scheduling needs by leveraging Microsoft Graph API for seamless integration with Outlook services.\n",
"\n",
"**Instructions**:\n",
"- When asked to perform a task, use the available actions via the microsoft.graph.com API.\n",
"- You should behave professionally and provide clear, concise responses.\n",
"- Offer assistance with tasks such as drafting emails, scheduling meetings, organising calendar events, and retrieving email or event details.\n",
"- Ask for clarification when needed to ensure accuracy and completeness in fulfilling user requests.\n",
"- Always conclude an email by signing off with logged in user's name which can be retrieved via the User.Read endpoint\n"
"Once you've created a Custom GPT, copy the text below in the Actions panel. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail."
" summary: Get the authenticated user's calendar events\n",
" security:\n",
" - OAuth2: []\n",
" responses:\n",
" '200':\n",
" description: A list of calendar events\n",
" content:\n",
" application/json:\n",
" schema:\n",
" type: array\n",
" items:\n",
" $ref: '#/components/schemas/CalendarEvent'\n",
" post:\n",
" operationId: createUserCalendarEvent\n",
" summary: Create a new calendar event for the authenticated user\n",
" security:\n",
" - OAuth2: []\n",
" requestBody:\n",
" required: true\n",
" content:\n",
" application/json:\n",
" schema:\n",
" $ref: '#/components/schemas/NewEvent'\n",
" responses:\n",
" '201':\n",
" description: Created\n",
" content:\n",
" application/json:\n",
" schema:\n",
" $ref: '#/components/schemas/CalendarEvent'\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Authentication Instructions"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Below are instructions on setting up authentication with Outlook. Have questions? Check out [Getting Started Example](https://platform.openai.com/docs/actions/getting-started) to see how this step works in more detail.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Azure Steps"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"1. <b>App Registration</b>: The first step is to register a new App registration in the [Azure Portal](portal.azure.com) which will be used to integrate OAuth between our application and Azure Active Directory/Entra ID. Simply provide the application with a relevant name, leaving the Redirect URI blank for now as we will return to this, and save."
"2. <b>Certificate & Secrets</b>: We next need to generate a client secret to provide secure communication between the GPT and Azure. Within the App registration, navigate to <b>Certificate & secrets</b> in the sidebar"
"Click New client secret and create a new client secret with desired name and expiry date. Clicking save will provide us a Secret to use in our GPT creation. Make sure to save the **Value** field as it’ll only be visible at creation, and we will need it later!"
"Click <b>Add a permission</b> and <b>Microsoft graph > Delegated Permissions</b> as options in the opened side menu. Use the search bar to add the following permissions:\n",
"- In the Azure app, navigate to the **Manage > Authentication** tab, click **Add a platform**, select **Web** and add your callback URL under **Redirect URI**\n"
"- **Callback URL Error**: If you get a callback URL error in ChatGPT, double check the Callback URL value as it can occasionally change depending on any alterations made to the authentication\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*Are there integrations that you’d like us to prioritize? Are there errors in our integrations? File a PR or issue in our github, and we’ll take a look.*\n"