ArcGIS Rest API in C#. submitting the job to ConnectOriginsToDestinations service - c#

I'm getting started with the online ArcGIS analysis services API. I've hit a dead-end with the connectOriginsToDestinations analysis task; even with a minimal request, I get a job failure with the response "Operation failed. Invalid URL (code = 400)".
Unfortunately, that's not much to go on, as I can't figure out from the error exactly which field in the job request the api is complaining about. The response from the job submission is "esriJobSubmitted", with a jobId to lookup, but when polling for job status, the first poll always gives me the failure message.
{
"type": "esriJobMessageTypeError",
"description": "Operation failed. Invalid URL (code = 400)."
}
Request parameters:
Job submission URL: >>https://analysis2.arcgis.com/arcgis/rest/services/tasks/GPServer/connectOriginsToDestinations/submitJob?
Job status poll URL : >>https://analysis2.arcgis.com/arcgis/rest/services/tasks/GPServer/connectOriginsToDestinations/jobs/jc004ad8813c14d75b4bf157c43b2149d?f=json&token=MYTOKEN
Submitted Task contents (a form-encoded POST body with the following fields):
f: json
token: <my token>
originsLayer: <json blob below>
destinationsLayer: <json blob below>
measurementType: "StraightLine"
Detail: originsLayer:
{
"layerDefinition": {
"geometryType": "esriGeometryPoint",
"fields": [
{
"name": "Id",
"type": "esriFieldTypeString",
"alias": "Id"
}
]
},
"featureSet": {
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"x": -77.694145,
"y": 45.478969
},
"attributes": {
"Id": "id1"
}
}
]
}
}
Detail: destinationsLayer:
{
"layerDefinition": {
"geometryType": "esriGeometryPoint",
"fields": [
{
"name": "Id",
"type": "esriFieldTypeString",
"alias": "Id"
}
]
},
"featureSet": {
"geometryType": "esriGeometryPoint",
"spatialReference": {
"wkid": 4326
},
"features": [
{
"geometry": {
"x": -77.694145,
"y": 45.478969
},
"attributes": {
"Id": "id1"
}
},
{
"geometry": {
"x": -77.476424,
"y": 46.090899
},
"attributes": {
"Id": "id2"
}
}
]
}
}

Related

C# How to get exact error message from Logic App triggered by HttpRequest instead of default error message?

I have a simple console application and it calls a Logic App by HttpRequest.
When the Logic App fails at any step I want to get exact the error message saying why it fails.
In the Logic App I can see the error.
Example: in the image, it fails at step 2 which it can't convert a string into an int. It's saying:
InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
which is what's I expect.
Here is my Logic App design:
But when I debug in a console application, it gives me a message "The server did not receive a response from an upstream server. Request tracking id 'some random Ids'." which is not very useful.
Here is my console application:
var obj = new
{
Age = "Twenty",
Name = "James"
};
using (var client = new HttpClient())
{
var content = new StringContent(JsonConvert.SerializeObject(obj));
content.Headers.ContentType.MediaType = "application/json";
var response = await client.PostAsync(url, content);
var errorMessage = await response.Content.ReadAsStringAsync();
//errorMessage: {"error":{"code":"NoResponse","message":"The server did not receive a response from an upstream server. Request tracking id 'some random Ids'."}}
}
So is there anyway to make the C# response return the error message in the step 2 of the Logic App?
What I expect is:
InvalidTemplate. Unable to process template language expressions in action 'Parse_JSON' inputs at line '0' and column '0': 'Required property 'content' expects a value but got null. Path ''.'.
Not:
{"error":{"code":"NoResponse","message":"The server did not receive a response from an upstream server. Request tracking id 'some random Ids'."}}
Thank you in advanced.
You can use actions('<Your_Previous_Step>')['error'] in your case actions('Parse_JSON')['error'] doing so you can able to retrieve the error message of that particular action.
Here is my logic app
I'm testing this through postman. Below is the response I received in postman.
Make sure you set Configure run after options to make the flow work even after it gets failed.
Updated Answer (General Solution)
In this case you can initialise a string variable and then add Append to string variable for each step so that it can catch the previous steps error. Below is the screenshot of my logic app.
Response in my postman
NOTE: Make sure you set Configure run after property for each action.
You can use the Scope action to encase the vast majority of other actions and then if something fails, you can catch the step for which it fails at.
You can load this JSON definition into your own tenant and see a working version.
{
"definition": {
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"Filter_array": {
"inputs": {
"from": "#variables('Result')",
"where": "#equals(item()['status'], 'Failed')"
},
"runAfter": {
"Initialize_Result": [
"Succeeded"
]
},
"type": "Query"
},
"Initialize_Error_Message": {
"inputs": {
"variables": [
{
"name": "Error Message",
"type": "string",
"value": "#{body('Filter_array')[0]['error']['message']}"
}
]
},
"runAfter": {
"Filter_array": [
"Succeeded"
]
},
"type": "InitializeVariable"
},
"Initialize_Integer_Variable": {
"inputs": {
"variables": [
{
"name": "Integer Variable",
"type": "integer",
"value": 1
}
]
},
"runAfter": {},
"type": "InitializeVariable"
},
"Initialize_Result": {
"inputs": {
"variables": [
{
"name": "Result",
"type": "array",
"value": "#result('Scope')"
}
]
},
"runAfter": {
"Scope": [
"Succeeded",
"FAILED"
]
},
"type": "InitializeVariable"
},
"Scope": {
"actions": {
"Set_Integer_Variable_(Step_1)": {
"inputs": {
"name": "Integer Variable",
"value": 2
},
"runAfter": {},
"type": "SetVariable"
},
"Set_Integer_Variable_(Step_2)": {
"inputs": {
"name": "Integer Variable",
"value": "#string('Test')"
},
"runAfter": {
"Set_Integer_Variable_(Step_1)": [
"Succeeded"
]
},
"type": "SetVariable"
},
"Set_Integer_Variable_(Step_3)": {
"inputs": {
"name": "Integer Variable",
"value": 3
},
"runAfter": {
"Set_Integer_Variable_(Step_2)": [
"Succeeded"
]
},
"type": "SetVariable"
}
},
"runAfter": {
"Initialize_Integer_Variable": [
"Succeeded"
]
},
"type": "Scope"
}
},
"contentVersion": "1.0.0.0",
"outputs": {},
"parameters": {},
"triggers": {
"Recurrence": {
"evaluatedRecurrence": {
"frequency": "Month",
"interval": 12
},
"recurrence": {
"frequency": "Month",
"interval": 12
},
"type": "Recurrence"
}
}
},
"parameters": {}
}
Naturally, it's a little more intensive and follows the same principals as a normal flow for continuing to the next step after a failure but this will help you with larger flows.
This is what the test flow looks like ...
To explain it quickly, the middle steps are simple Set Variable actions that can be changed to cause the failure.
In the definition I've given you, step 2 will fail but you can change it to step 1 or 3 and you should still see the error come out at the end regardless of the step in the scope action that fails.
I suggest playing with it and looking at the output to the scope action, which is written to variable Result in the Initialize Result step.
For reference, this is the sort of information that comes out of the Scope action that you can use to determine what has failed.
{
"variables": [
{
"name": "Result",
"type": "Array",
"value": [
{
"name": "Set_Integer_Variable_(Step_1)",
"inputs": {
"name": "Integer Variable",
"value": 2
},
"outputs": {
"body": {
"name": "Integer Variable",
"value": 2
}
},
"startTime": "2022-04-22T06:55:57.8965917Z",
"endTime": "2022-04-22T06:55:57.9281959Z",
"trackingId": "0c93fa70-a552-4776-bce1-8ac889933de9",
"clientTrackingId": "08585509963278112157168286283CU11",
"status": "Succeeded"
},
{
"name": "Set_Integer_Variable_(Step_2)",
"startTime": "2022-04-22T06:55:57.9434709Z",
"endTime": "2022-04-22T06:55:57.9434709Z",
"trackingId": "f82b494b-0ecd-412b-887a-d4b08f4a5751",
"clientTrackingId": "08585509963278112157168286283CU11",
"code": "BadRequest",
"status": "Failed",
"error": {
"code": "BadRequest",
"message": "The variable 'Integer Variable' of type 'Integer' cannot be initialized or updated with value of type 'String'. The variable 'Integer Variable' only supports values of types 'Integer'."
}
},
{
"name": "Set_Integer_Variable_(Step_3)",
"startTime": "2022-04-22T06:55:57.9590957Z",
"endTime": "2022-04-22T06:55:57.9590957Z",
"trackingId": "f761d71f-8ec0-4a29-9a8a-a39a81faf660",
"clientTrackingId": "08585509963278112157168286283CU11",
"code": "ActionSkipped",
"status": "Skipped",
"error": {
"code": "ActionConditionFailed",
"message": "The execution of template action 'Set_Integer_Variable_(Step_3)' is skipped: the 'runAfter' condition for action 'Set_Integer_Variable_(Step_2)' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'."
}
}
]
}
]
}
Take note, you still need to apply the Configure run after properties to ensure it continues on after the Scope action finishes ...
You'd need to put some more error checking in but my suggestion would be to wrap all of that functionality into another LogicApp that you can reuse across your tenant. That's the thinking anyway.

Error using Google wallet in Xamarin Android

I'm trying to use Google Pay in my Xamarin app. First I added the GooglePlayServices package from nuget
then I followed the documentation from here
here is my JSON
{
"apiVersion": 2,
"apiVersionMinor": 0,
"merchantInfo": { "merchantName": "testName" },
"allowedPaymentMethods": [
{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]
}
},
{
"type": "PAYMENT_GATEWAY",
"parameters": { "gateway": "firstdata", "gatewayMerchantId": "12365" }
}
],
"transactionInfo": {
"totalPriceStatus": "FINAL",
"totalPrice": "4.10",
"currencyCode": "USD",
"checkoutOption": "COMPLETE_IMMEDIATE_PURCHASE"
}
}
code:
paymentsClient = WalletClass.GetPaymentsClient(
Xamarin.Essentials.Platform.CurrentActivity,
new WalletClass.WalletOptions.Builder()
.SetEnvironment(WalletConstants.EnvironmentTest)
.Build());
var request = PaymentDataRequest.FromJson(json);
AutoResolveHelper.ResolveTask(paymentsClient.LoadPaymentData(request),
Xamarin.Essentials.Platform.CurrentActivity, 999);
but I get an error Code 10: Developer Error
and if I do it like this
var result = await paymentsClient.LoadPaymentDataAsync(request);
I get the following error 6: BuyFlow UI needs to be shown.
after rereviewing the documentation I realized that my json object was wrong instead of
{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]
}
},
{
"type": "PAYMENT_GATEWAY",
"parameters": { "gateway": "firstdata", "gatewayMerchantId": "12365" }
}
it needs to look like this: as tokenizationSpecification part of the payment method object
{
"type": "CARD",
"parameters": {
"allowedAuthMethods": ["PAN_ONLY", "CRYPTOGRAM_3DS"],
"allowedCardNetworks": ["AMEX", "DISCOVER", "MASTERCARD", "VISA"]
},
"tokenizationSpecification": {
"type": "PAYMENT_GATEWAY",
"parameters": { "gateway": "firstdata", "gatewayMerchantId": "12365" }
}
what I'm wondering is why didnt it throw an error when I called PaymentDataRequest.FromJson(json)

Getting an error of Existing Resource while using function ARM template

I am wrting a Function ARM template for CI/CD the function is already hosted on the Azure portal Now I decided to create an ARM function template and am getting the below error. It saying I cannot create a resource which already exists. I know the resource already exists but I want to create a CI/CD pipline based on the template. I have tried the incremental mode but it seems I am missing something. Is there any guidance online? I have taken the Azure Function Template from the AZURE Git.
C:\Program Files\Microsoft SDKs\Azure.NET SDK\v2.9> az group deployment validate --mode Incremental --resource-group cloud-shell-storage-southeastasia --template-file azuredeploy.json
Please provide string value for 'appName' (? for help): SchedulerHttpFunctionSample
azuredeploy.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string",
"metadata": {
"description": "The name of the function app that you wish to create."
}
},
"storageAccountType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS"
],
"metadata": {
"description": "Storage Account type"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
},
"runtime": {
"type": "string",
"defaultValue": "node",
"allowedValues": [
"node",
"dotnet",
"java"
],
"metadata": {
"description": "The language worker runtime to load in the function app."
}
}
},
"variables": {
"functionAppName": "[parameters('appName')]",
"hostingPlanName": "[parameters('appName')]",
"applicationInsightsName": "[parameters('appName')]",
"storageAccountName": "[concat(uniquestring(resourceGroup().id), 'azfunctions')]",
"storageAccountid": "[concat(resourceGroup().id,'/providers/','Microsoft.Storage/storageAccounts/', variables('storageAccountName'))]",
"functionWorkerRuntime": "[parameters('runtime')]"
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[variables('storageAccountName')]",
"apiVersion": "2018-12-01",
"location": "[parameters('location')]",
"kind": "Storage",
"sku": {
"name": "[parameters('storageAccountType')]"
},
"properties":{
"mode":"Incremental"
}
},
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2018-02-01",
"name": "[variables('hostingPlanName')]",
"location": "[parameters('location')]",
"sku": {
"name": "Y1",
"tier": "Dynamic"
},
"properties": {
"mode":"Incremental",
"name": "[variables('hostingPlanName')]",
"computeMode": "Dynamic"
}
},
{
"apiVersion": "2018-02-01",
"type": "Microsoft.Web/sites",
"name": "[variables('functionAppName')]",
"location": "[parameters('location')]",
"kind": "functionapp",
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"[resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))]"
],
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('hostingPlanName'))]",
"mode":"Incremental",
"siteConfig": {
"appSettings": [
{
"name": "AzureWebJobsStorage",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=', variables('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountid'),'2015-05-01-preview').key1)]"
},
{
"name": "WEBSITE_CONTENTSHARE",
"value": "[toLower(variables('functionAppName'))]"
},
{
"name": "FUNCTIONS_EXTENSION_VERSION",
"value": "~2"
},
{
"name": "WEBSITE_NODE_DEFAULT_VERSION",
"value": "~10"
},
{
"name": "APPINSIGHTS_INSTRUMENTATIONKEY",
"value": "[reference(resourceId('microsoft.insights/components/', variables('applicationInsightsName')), '2015-05-01').InstrumentationKey]"
},
{
"name": "FUNCTIONS_WORKER_RUNTIME",
"value": "[variables('functionWorkerRuntime')]"
}
]
}
}
},
{
"apiVersion": "2018-02-01",
"name": "[variables('applicationInsightsName')]",
"type": "microsoft.insights/components",
"location": "East US",
"tags": {
"[concat('hidden-link:', resourceGroup().id, '/providers/Microsoft.Web/sites/', variables('applicationInsightsName'))]": "Resource"
},
"properties": {
"ApplicationId": "[variables('applicationInsightsName')]",
"Request_Source": "IbizaWebAppExtensionCreate",
"mode":"Incremental"
}
}
]
}
Azure Error: InvalidResourceLocation
Message: The resource 'SchedulerHttpFunctionSample' already exists in location 'southcentralus' in resource group 'cloud-shell-storage-southeastasia'. A resource with the same name cannot be created in location 'southeastasia'. Please select a new resource name.
It's because that name is already taken. Function App name need to be globally unique.
I would suggest using a suffix. In the variables section create some variables:
"variables": {
"suffix": "[uniqueString(resourceGroup().id, resourceGroup().location)]",
"functionAppName": "[concat(parameters('appName'), variables('suffix'))]"
}
The function uniqueString will generate a unique string base on the information received. So if you redeploy in the same resource group and region the suffix will be the same.
Have a look to this post: http://www.frankysnotes.com/2019/05/how-to-make-your-deployment-successful.html or this video https://www.youtube.com/watch?v=dnb-f4C052w

How to mount a File Storage volume to an azure container instance using REST api

I'm trying to create an Azure container instance and mounting a File Storage volume via REST API, but I'm getting 400 response.
I'm able to create the container and keep it running but when I add the volume part it returns a 400 response (Bad request) without further explanation
Here is the JSON payload I'm sending to the REST endpoint:
{
"id": "/subscriptions/111111111/resourceGroups/OraResourceGroup/providers/Microsoft.ContainerInstance/containerGroups/solver",
"location": "West Europe",
"name": "solver",
"properties": {
"volumes": [
{
"azureFile": {
"shareName": "orafileshare",
"storageAccountKey": "somekey",
"storageAccountName": "myaccountname"
},
"name": "Volume1"
}
],
"containers": [
{
"name": "solver",
"properties": {
"command": [],
"environmentVariables": [],
"image": "acraccount/solver:v1",
"ports": [
{
"port": 12345
}
],
"resources": {
"requests": {
"cpu": 1.0,
"memoryInGB": 1.5
}
},
"volumeMounts": [
{
"name": "Volume1",
"mountPath": "/mountFolder"
}
]
}
}
],
"imageRegistryCredentials": [
{
"password": "123123123213123",
"server": "acr.server.io",
"username": "acrOra"
}
],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 12345
}
],
"type": "Public"
},
"osType": "Linux",
"restartPolicy": "Always"
},
"type": "Microsoft.ContainerInstance/containerGroups"
}
The expected results is a 200 or 201 response and the container should appear on my Azure portal dashboard but the actual response is 400.
There are 2 issues with this correction. I also received 400 bad request but later corrected it and I was able to run it successfully.
Name of volume, capital letter is not allowed.
Change "Volume1" to "volume1"
Reference Error :
{"error":{"code":"InvalidVolumeName","message":"The volume name 'Volume1' is invalid. The volume name must match the regex '[a-z0-9]([-a-z0-9]*[a-z0-9])?' (e.g. 'my-name')."}}
Sku is not a valid property, Remove it
{"error":{"code":"InvalidRequestContent","message":"The request
content was invalid and could not be deserialized: 'Could not find
member 'sku' on object of type 'ComputeResources'. Path
'properties.containers[0].properties.resources.requests.sku', line 32,
position 22.'."}}
Reference https://learn.microsoft.com/en-us/rest/api/container-instances/containergroups/createorupdate#resourcerequests
Sample configuration
{
"id": "/subscriptions/xxxx/resourceGroups/teststoragerest/providers/Microsoft.ContainerInstance/containerGroups/solver",
"location": "West Europe",
"name": "demo1forrahul",
"properties": {
"volumes": [
{
"azureFile": {
"shareName": "testfilestorage",
"storageAccountKey": "xxxx",
"storageAccountName": "xxxxxx"
},
"name": "volume1"
}
],
"containers": [
{
"name": "demo1forrahul",
"properties": {
"command": [],
"environmentVariables": [],
"image": "nginx",
"ports": [
{
"port": 80
}
],
"resources": {
"requests": {
"cpu": 1.0,
"memoryInGB": 1.5
}
},
"volumeMounts": [
{
"name": "volume1",
"mountPath": "/testfolder"
}
]
}
}
],
"imageRegistryCredentials": [],
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public"
},
"osType": "Linux",
"restartPolicy": "Always"
},
"type": "Microsoft.ContainerInstance/containerGroups"
}

Sending Messages through Microsoft Graph API with SchemaExtension Data

I'm looking for some help formatting schema extension data in Microsoft's Graph API. I've been able to successfully send Office 365 messages in code and through the Graph Explorer using this body:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo#email.com"
}
}
]
}
}
I created a schema extension and promoted it to "Available" status. I can query the extension to verify it's available and get this response body:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#schemaExtensions",
"value": [
{
"id": "extc5bnq6uk_TestExtension",
"description": "Test Extension",
"targetTypes": [
"Message"
],
"status": "Available",
"owner": "mysecretclienttenantgoeshere",
"properties": [
{
"name": "ValueOne",
"type": "String"
},
{
"name": "ValueTwo",
"type": "String"
}
]
}
]
}
So far I haven't been able to append extension data to a new message. I've tried formatting my request body like this:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo#email.com"
}
}
],
"extc5bnq6uk_TestExtension": {
"ValueOne": "TestValue",
"ValueTwo": "TestValue"
}
}
}
and like this:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo#email.com"
}
}
],
"extensions":[
{
"extc5bnq6uk_TestExtension" : {
"ValueOne" : "TestValue"
"ValueTwo" : "TestValue"
}
}
]
}
}
Both formats return a 400 code with response body:
{
"error": {
"code": "RequestBodyRead",
"message": "The property 'extc5bnq6uk_TestExtension' does not exist on type 'Microsoft.OutlookServices.Message'. Make sure to only use property names that are defined by the type or mark the type as open type.",
"innerError": {
"request-id": "21792fd0-44d1-42aa-8d51-f8abc92cbd04",
"date": "2018-08-14T16:39:31"
}
}
}
I'm posting to this URL in the graph explorer:
https://graph.microsoft.com/v1.0/me/sendMail
and to the "messages" and "sendMail" endpoints in code.
I found the answer in the Known Limitations of the documentation. Certain resource types, including messages, have to be done in two stages, an initial post and then a follow up patch.
Creating the message and then patching with this JSON returned a valid response.
{
"extc5bnq6uk_TestExtension": {
"ValueOne": "Test Value One",
"ValueTwo": "Test Value Two"
}
}
Unfortunately, another limitation for schema extensions on messages is that they can't be used to filter messages, which is what I was ultimately after.
Filtering on schema extension properties (using the $filter
expresssion) is not supported for Outlook entity types - contact,
event, message, or post.
Jeff
Based on your question you posted, you have created a schemaExtension successfully. I think you want to send an email with this schemaExtension, but when you send an email with this schemaExtension, we get the 400 code in the response.
Based on my test, I think we can use the request body as blow.
1.Create a schemaExtension like this:
{
"#odata.context":"https://graph.microsoft.com/v1.0/$metadata#schemaExtensions/$entity",
"id":"{extensionId}",
"description":"sample description",
"targetTypes":[
"Message"
],
"status":"Available",
"owner":"{owner id}",
"properties":[
{
"name":"p1",
"type":"String"
},
{
"name":"p2",
"type":"String"
}
]
}
Create a message
POST https://graph.microsoft.com/v1.0/me/messages
{
"message":{
"subject":"Meet for lunch?",
"body":{
"contentType":"Text",
"content":"The new cafeteria is open."
},
"toRecipients":[
{
"emailAddress":{
"address":"{toRecipients email address}"
}
}
],
"extensions":[
{
"#odata.type":"Microsoft.Graph.OpenTypeExtension",
"extensionName":"{extensionName}",
"p1":"Wingtip Toys",
"p2":"10000"
}
]
},
"saveToSentItems":"false"
}
when we send this message with the request, we will get the 202 code. The {toRecipients email address} will receive the email.

Categories