Microsoft Booking Appointment Graph API -Only Post Request Not working - api

when I trying to create Microsoft Booking Appointment through Graph API
Only Post Request Not working .
GET , PATCH , DELETE Reuqest are working fine
through postman
same post request is working find on graph explorer platform . but not on posmant with
my auth token
my post API
https://graph.microsoft.com/v1.0/solutions/bookingBusinesses/XXXXXXXXXXXXXXX.com/appointments
and body (took example from here)
excluded optional properties like servicename and customers
{
"#odata.type": "#microsoft.graph.bookingAppointment",
"customerTimeZone": "America/Chicago",
"smsNotificationsEnabled": false,
"endDateTime": {
"#odata.type": "#microsoft.graph.dateTimeTimeZone",
"dateTime": "2023-01-02T14:30:00.0000000",
"timeZone": "UTC"
},
"isLocationOnline": true,
"optOutOfCustomerEmail": false,
"anonymousJoinWebUrl": null,
"postBuffer": "PT10M",
"preBuffer": "PT5M",
"price": 10,
"priceType#odata.type": "#microsoft.graph.bookingPriceType",
"priceType": "fixedPrice",
"reminders#odata.type": "#Collection(microsoft.graph.bookingReminder)",
"reminders": [
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "This service is tomorrow",
"offset": "P1D",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "allAttendees"
},
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "Please be available to enjoy your lunch service.",
"offset": "PT1H",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "customer"
},
{
"#odata.type": "#microsoft.graph.bookingReminder",
"message": "Please check traffic for next cater.",
"offset": "PT2H",
"recipients#odata.type": "#microsoft.graph.bookingReminderRecipients",
"recipients": "staff"
}
],
"serviceId": "XXXXXXXXXXXXXXXXXXXXX",
"serviceLocation": {
"#odata.type": "#microsoft.graph.location",
"address": {
"#odata.type": "#microsoft.graph.physicalAddress",
"city": "Buffalo",
"countryOrRegion": "USA",
"postalCode": "98052",
"postOfficeBox": null,
"state": "NY",
"street": "123 First Avenue",
"type#odata.type": "#microsoft.graph.physicalAddressType",
"type": null
},
"coordinates": null,
"displayName": "Customer location",
"locationEmailAddress": null,
"locationType#odata.type": "#microsoft.graph.locationType",
"locationType": null,
"locationUri": null,
"uniqueId": null,
"uniqueIdType#odata.type": "#microsoft.graph.locationUniqueIdType",
"uniqueIdType": null
},
"serviceNotes": "Customer requires punctual service.",
"startDateTime": {
"#odata.type": "#microsoft.graph.dateTimeTimeZone",
"dateTime": "2023-01-02T14:00:00.0000000",
"timeZone": "UTC"
},
"maximumAttendeesCount": 1,
"filledAttendeesCount": 1
}

Related

how to convert json response to List in c# RestSharp

Currently I am working on asp .NET 5 console application with Restsharp, My Api Get request is working on postman, but I am struggling to convert this json object to a list .
This is my json object:
"data": {
"domain": "intel.com",
"disposable": false,
"webmail": false,
"accept_all": false,
"pattern": "{first}.{last}",
"organization": "Intel",
"country": "US",
"state": null,
"emails": [
{
"value": "danielle.sikich#intel.com",
"type": "personal",
"confidence": 99,
"sources": [
{
"domain": "github.com",
"uri": "http://github.com/hpc/mpifileutils",
"extracted_on": "2021-10-28",
"last_seen_on": "2021-10-28",
"still_on_page": true
}
],
"first_name": "Danielle",
"last_name": "Sikich",
"position": null,
"seniority": null,
"department": null,
"linkedin": null,
"twitter": null,
"phone_number": null,
"verification": {
"date": "2021-11-05",
"status": "valid"
}
},
I tried this but its not working:
List<Job> JobList = JsonConvert.DeserializeObject<List<Job>>(jsonResponse["data"]["emails"]["value"].ToString());

How to process payments with service fee being deducted in Visa Cybersource Payments API?

I have an app that I would like to add payment processing similar to Amazon payment processing into it where sub-merchants get paid by customers with service fee being deducted, I can see in https://developer.visa.com/capabilities/cybersource/reference#cybersource__cybs_payments_v2__v2__process_a_payment the following request body but there is no field in request body to specify a service fee:
{
"clientReferenceInformation": {
"code": "TC588171_3"
},
"processingInformation": {
"commerceIndicator": "internet"
},
"aggregatorInformation": {
"subMerchant": {
"cardAcceptorID": "1234567890",
"country": "US",
"phoneNumber": "650-432-0000",
"address1": "900 Metro Center",
"postalCode": "94404-2775",
"locality": "Foster City",
"name": "Visa Inc",
"administrativeArea": "CA",
"region": "PEN",
"email": "test#cybs.com"
},
"name": "V-Internatio",
"aggregatorID": "123456789"
},
"orderInformation": {
"billTo": {
"country": "US",
"lastName": "VDP",
"address2": "Address 2",
"address1": "201 S. Division St.",
"postalCode": "48104-2201",
"locality": "Ann Arbor",
"administrativeArea": "MI",
"firstName": "RTS",
"phoneNumber": "999999999",
"district": "MI",
"buildingNumber": "123",
"company": "Visa",
"email": "test#cybs.com"
},
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD"
}
},
"paymentInformation": {
"card": {
"expirationYear": "2031",
"number": "5555555555554444",
"securityCode": "123",
"expirationMonth": "12",
"type": "002"
}
}
}
Is there a way or a workaround to get a service fee deducted?
Service fees go in the orderInformation block. Like this:
"orderInformation": {
"amountDetails": {
"totalAmount": "102.21",
"currency": "USD",
"serviceFeeAmount": "3.00"
},
There are a few prerequisites to using service fees. One of which you must be using First Data as your processor. For more details check this documentation.

I'm getting the location_id as null in shopify order api

I created an order through shopify admin and added the customer details , when i executes the orders.json api , I'm getting location_id ="null"
Now i'm in need of location id to update the fulfillment status.
How to update the location id for an order if possible .This is my response when i created an order .
{
"orders": [
{
"id": 568323571800,
"email": "sample_test_123_gmail#gmail.com",
"closed_at": null,
"created_at": "2018-08-02T15:41:06+05:30",
"updated_at": "2018-08-02T15:46:06+05:30",
"number": 9,
"note": "",
"token": "a666eb3aea251cc585afc006cbf5b315",
"gateway": "Cash on Delivery (COD)",
"test": false,
"total_price": "200.00",
"subtotal_price": "200.00",
"total_weight": 100,
"total_tax": "0.00",
"taxes_included": false,
"currency": "INR",
"financial_status": "pending",
"confirmed": true,
"total_discounts": "0.00",
"total_line_items_price": "200.00",
"cart_token": null,
"buyer_accepts_marketing": false,
"name": "#1009",
"referring_site": null,
"landing_site": null,
"cancelled_at": null,
"cancel_reason": null,
"total_price_usd": "2.92",
"checkout_token": null,
"reference": null,
"user_id": 23090102360,
"location_id": null,
location ID is tied to your inventory. First off, ensure you have set a location for your inventory. Second, make sure Shopify is set as your inventory management provider. If you now create an order for items managed by Shopify, you might see a location ID. Your test of creating a draft order like that might also not be fully integrated yet with Shopify locations? What happens when you book an order using the front end and not the API?
location_id on an order will return null unless the order is made from a Shopify POS location in which case it will return the location_id associated with that location.
See the guide on fulfillments: https://help.shopify.com/en/api/guides/managing-fulfillments
To get locationId in order, need to pass inventoryQuantities input with location id and available quantity in productCreate Mutation.Then You will get locationId in order
{
"input": {
"title": "Demo Product",
"descriptionHtml": "des",
"productType": "type",
"vendor": "vendor",
"handle": "abc1",
"tags": ["tag1", "tag2"],
"variants": [
{
"title": "small",
"price": 100,
"compareAtPrice": 110,
"position": 1,
"inventoryQuantities": {
"availableQuantity": 100,
"locationId": "gid://shopify/Location/55274340513"
},
"inventoryItem": {
"cost": 200,
"tracked": true
}
}
]
}
}
You can find location_id from the /admin/api/2021-04/locations.json API.
You will get response like this:
{
"locations": [
{
"id": location_id,
"name": "location_name",
"address1": "location_address",
"address2": null,
"city": "Faisalabad",
"zip": "38000",
"province": "",
"country": "PK",
"phone": "",
"created_at": "2021-02-25T15:34:18+05:00",
"updated_at": "2021-02-25T15:34:20+05:00",
"country_code": "PK",
"country_name": "Pakistan",
"province_code": null,
"legacy": false,
"active": true,
"admin_graphql_api_id": "gid://shopify/Location/location_id",
"localized_country_name": "Pakistan",
"localized_province_name": null
}
]
}

Intune azure graph api to Create deviceCompliancePolicyState Returns 400 Bad Request

Call
GET https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/
RESPONSE
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#managedDevices/$entity",
"id": "dd9615c4-9d3b-4ece-9272-34a10e8fe908",
"userId": null,
"deviceName": "iPad Feb23",
"hardwareInformation": {
"serialNumber": null,
"totalStorageSpace": 0,
"freeStorageSpace": 0,
"imei": "",
"meid": null,
"manufacturer": null,
"model": null,
"phoneNumber": null,
"subscriberCarrier": null,
"cellularTechnology": null,
"wifiMac": null,
"operatingSystemLanguage": null,
"isSupervised": false,
"isEncrypted": false,
"isSharedDevice": false,
"sharedDeviceCachedUsers": []
},
"ownerType": "personal",
"deviceActionResults": [],
"managementState": "managed",
"enrolledDateTime": "2017-05-24T13:10:20.8964572Z",
"lastSyncDateTime": "2017-05-24T15:16:02.6465376Z",
"chassisType": "tablet",
"operatingSystem": "iOS",
"deviceType": "iPad",
"complianceState": "compliant",
"jailBroken": "False",
"managementAgents": 2,
"managementAgent": "mdm",
"osVersion": "9.3.5",
"easActivated": false,
"easDeviceId": null,
"easActivationDateTime": "0001-01-01T00:00:00Z",
"aadRegistered": null,
"enrollmentType": "userEnrollmentWithServiceAccount",
"lostModeState": "disabled",
"activationLockBypassCode": null,
"emailAddress": null,
"azureActiveDirectoryDeviceId": "00000000-0000-0000-0000-000000000000",
"deviceRegistrationState": "registered",
"deviceCategoryDisplayName": null,
"isSupervised": false,
"exchangeLastSuccessfulSyncDateTime": "0001-01-01T00:00:00Z",
"exchangeAccessState": "none",
"exchangeAccessStateReason": "none",
"remoteAssistanceSessionUrl": "",
"isEncrypted": false,
"model": null,
"manufacturer": null
}
But when i try to do post nothing seems to work ... according to the doc here https://developer.microsoft.com/en-us/graph/docs/api-reference/beta/api/intune_mam_mobileappidentifierdeployment_create
it should work just fine what is the problem with this call ...?
Call
POST https://graph.microsoft.com/beta/managedDevices/dd9615c4-9d3b-4ece-9272-34a10e8fe908/deviceCompliancePolicyStates/
{
"#odata.type": "#microsoft.graph.deviceCompliancePolicyState",
"settingStates": [
{
"#odata.type": "microsoft.graph.deviceCompliancePolicySettingState",
"setting": "Setting value",
"instanceDisplayName": "Instance Display Name value",
"state": "notApplicable",
"errorCode": 9,
"errorDescription": "Error Description value",
"userPrincipalName": "User Principal Name value",
"sources": [
{
"#odata.type": "microsoft.graph.settingSource",
"id": "Id value",
"displayName": "Display Name value"
}
]
}
],
"displayName": "Display Name value",
"version": 7,
"platformType": "androidForWork",
"state": "notApplicable",
"settingCount": 12
}
RESPONSE
{
"error": {
"code": "No method match route template",
"message": "No OData route exists that match template ~/entityset/key/navigation with http verb POST for request /StatelessDeviceConfigurationFEService/managedDevices('dd9615c4-9d3b-4ece-9272-34a10e8fe908')/deviceCompliancePolicyStates.",
"innerError": {
"request-id": "544c4ee2-a6de-4203-9c30-c3e589b77713",
"date": "2017-05-24T15:48:30"
}
}
}
I'm an engineer on the Microsoft Intune team specifically working on the integration between Microsoft Graph and Microsoft Intune.
In this case it looks like there is an issue with the documentation as deviceCompliancePolicyState entity can not be created, it is read-only entity that shows the state of a device compliance policy. I will work to get the documentation corrected. If you can let me know what scenario you were trying to accomplish by creating a deviceCompliancePolicyState entity I may be able to point you in the right direction.
Hope that helps
Peter

add tracking to mandrill send-template

My mandrill keeps saying my message is not opened when I call messages/info.json despite I have added tracking.
here is my request:
{
"key": "mykey",
"template_name": "message",
"template_content": {},
"message": {
"html": null,
"text": null,
"subject": "test",
"from_email": "info#test.io",
"from_name": "test",
"to": [
{
"email": "rob.proesmans#test.be",
"name": "rob",
"type": "to"
}
],
"headers": null,
"important": null,
"track_opens": true,
"track_clicks": true,
etc..
my mandrill response when i call /messages/info.json
{
"ts": 1455290984,
"_id": "3e5877fc43044841ab505f999b4a5b00",
"state": "sent",
"subject": "test",
"email": "rob.proesmans#redtree.be",
"tags": {},
"opens": 0,
"clicks": 0,
"smtp_events": [
{
"ts": 1455290986,
"type": "sent",
"diag": "250 2.0.0 OK 5E/A9-30218-21AFDB65",
"source_ip": "198.2.134.26",
"destination_ip": "94.143.184.119",
"size": 23062
}
],
"resends": {},
"sender": "info#redtree.io",
"template": "pocmessage",
"opens_detail": {},
"clicks_detail": {}
}
After 5minutes.. still no result after opening the mail..
What am i doing wrong?
Thank you
I takes around 2 hours till Mandrill knows when your mail is opened.