Bug: findMeetingTimes throws “AttendeesUnavailable” even for optional attendees - outlook

I'm trying to use the https://outlook.office.com/api/v2.0/me/findmeetingtimes endpoint documented on the MSDN Outlook Calendar website. When I call the endpoint with the following payload:
{
"Attendees": [
{
"Type": "optional",
"EmailAddress": {
"Name": "Studio 3",
"Address": "PDXICSTUDIO3#rogueInc.onmicrosoft.com"
}
}
],
"TimeConstraint": {
"ActivityDomain":"Unrestricted",
"Timeslots": [
{
"Start": {
"DateTime": "2018-10-30T19:30:00",
"TimeZone": "UTC"
},
"End": {
"DateTime": "2018-10-30T20:30:00",
"TimeZone": "UTC"
}
}
]
},
"ReturnSuggestionReasons": "true",
"IsOrganizerOptional": false,
"MaxCandidates": 99
}
I get an empty meeting time suggestions response with the reason provided as "AttendeesUnavailable". It doesn't seem to matter whether I declare the type of the attendee as "optional", "required", or "resource" as specified in the attendeeBase Resource Type documentation. This seems like a bug with the GraphAPI and I'm unsure as to how to proceed.

Related

How to change/customize the response format of Lighthouse?

I am using Lighthouse GraphQL with Laravel 9 for my application. Graphql have standard format and each response show under the data and operation name. It does not show proper response (error/success) to handle for front-end application. Because, on the basis of error code iOS/Android/frontend may work easily. Here is the sample:
Request:
query Translations {
translations {
name
slug
}
}
Response:
{
"data": {
"translations": [
{
"name": "English",
"slug": "en_US"
},
{
"name": "English (United Kingdom)",
"slug": "en_UK"
}
]
}
}
I have tried to override response with Laravel response classes and create custom queries/mutations resolver. But, it returns all the information. This should use Graphql "Tailoring your need" also. So, I want to customize the response so that response should include code, status, message, data[].
The result I got:
{
"status": true,
"code": 200,
"message": "",
"data": [
{
"_id": "63b2d767e2a07754b20845f6",
"name": "English",
"slug": "en_US",
"isActive": true,
"isDefault": true,
"updated_at": "2023-01-02T13:08:54.940000Z",
"created_at": "2023-01-02T13:08:54.940000Z",
"logo": "/United-States.svg"
},
{
"_id": "63b3e78ae2a07754b20845ff",
"name": "English (United Kingdom)",
"slug": "en_UK",
"isActive": true,
"isDefault": false,
"updated_at": "2023-01-03T08:30:02.085000Z",
"created_at": "2023-01-03T08:30:02.085000Z",
"logo": "/Great-Britain.svg"
}
]
}
It should be:
{
"status": true,
"code": 200,
"message": "",
"data": [
{
"name": "English",
"slug": "en_US"
},
{
"name": "English (United Kingdom)",
"slug": "en_UK"
}
]
}
Lighthouse returns the response based on the GraphQL specification. You have the power to change the response with the EndRequest event. Listen to the event in AppServiceProvider and then manipulate the response in any form that you need.
/**
* #param Dispatcher $dispatcher
*
* #return void
*/
public function boot(Dispatcher $dispatcher): void {
$dispatcher->listen(
EndRequest::class,
function (EndRequest $endRequest) {
dd($endRequest->response);
});
}
It should be:
{
"status": true,
"code": 200,
"message": "",
"data": [
{
"name": "English",
"slug": "en_US"
},
{
"name": "English (United Kingdom)",
"slug": "en_UK"
}
]
}
I would strongly advise against this, as it violates the GraphQL specification:
To ensure future changes to the protocol do not break existing services and clients, the top level response map must not contain any entries other than the three described above.
Use extensions for custom additions. You can add to extensions in Lighthouse by listening to the BuildExtensionsResponse event, see https://lighthouse-php.com/master/api-reference/events.html#buildextensionsresponse

Microsoft Graph API UnableToDeserializePostBody 400 error

I'm trying to create recurring events under my outlook calendar and for that, I'm following instructions from here.
My payload looks like this:
{
"Subject": "Blocked By DEV",
"Body": {},
"Start": {
"DateTime": "2022-08-30T23:30:00",
"TimeZone": "Asia/Calcutta"
},
"End": {
"DateTime": "2022-08-30T23:45:00",
"TimeZone": "Asia/Calcutta"
},
"Recurrence": {
"pattern": {
"type": "WEEKLY",
"interval": 1,
"daysOfWeek": [
"Monday",
"Tuesday"
]
},
"range": {
"type": "numbered",
"startDate": "2022-08-30",
"numberOfOccurences": 3
}
}
}
I'm trying to hit the endpoint /me/events from Graph Explorer and getting this 400 error.
{
"error": {
"code": "UnableToDeserializePostBody",
"message": "were unable to deserialize "
}
}
Is there anything wrong with my payload? Is there any way to have more details about the failure?
Just spotted the culprit, numberOfOccurences was supposed to be numberOfOccurrences.
And if someone asks why I ended up doing that mistake, I just referred docs, and seems like official documentation has that typo.

NEAR transaction without receipt but with receipt_outcome

When querying archival node for transactions with EXPERIMENTAL_tx_status method, some transactions have no receipts while having receipts_outcome. How is that possible, and how is that transaction different from others?
If I understand correctly, receipts_outcome are the results of applying receipts. According to explorer, this transaction has Convert Transaction To Receipt part, so there should be some receipts generated.
According to documentation
A Receipt is the only actionable object in the system. When we talk about "processing a transaction" on the NEAR platform, this eventually means "applying receipts" at some point.
A good mental model is to think of a Receipt as a paid message to be executed at the destination (receiver). And a Transaction is an externally issued request to create the Receipt (there is a 1 to 1 relationship).
My query
{
"jsonrpc": "2.0",
"id": "2",
"method": "EXPERIMENTAL_tx_status",
"params": ["7beNxrbHxMRspJWT9NeEVwx719kVcmY9tRdPG9SYro26", "bumbleee99.near"]
}
Response
{
"jsonrpc": "2.0",
"result": {
"status": {
"SuccessValue": ""
},
"transaction": {
"signer_id": "bumbleee99.near",
"public_key": "ed25519:DFM5GRGbpNkk4XkhcFnRUFeKG8a3nzTH8NwZp754pC48",
"nonce": 59080995000003,
"receiver_id": "bumbleee99.near",
"actions": [
{
"AddKey": {
"public_key": "ed25519:CUoNs153GHrPZ9F8HpvhzFr1mwuUFUdGQsRNE2CTNjVH",
"access_key": {
"nonce": 0,
"permission": "FullAccess"
}
}
}
],
"signature": "ed25519:15v34qoyCHSvSL5uLcaPqD9vXvjcPrCaZVStCMms8e58C62z2UHiazwUXzHajPEgdHpwn7s4J9dd5UPmtvzbYgM",
"hash": "7beNxrbHxMRspJWT9NeEVwx719kVcmY9tRdPG9SYro26"
},
"transaction_outcome": {
"proof": [
{
"hash": "ECKDm5FVhzit7Wqs9sEyBB9NtuTrVRZmWwcxkkg2yUh4",
"direction": "Right"
},
{
"hash": "E4VXdwsNj3fZCbP6y9YH3M5oZHPDcdArqU9kbZJa95Qp",
"direction": "Right"
}
],
"block_hash": "ASY6HgDUQUXUa99L7dPEfghKEnEk5SNkwQrx24u3Fobz",
"id": "7beNxrbHxMRspJWT9NeEVwx719kVcmY9tRdPG9SYro26",
"outcome": {
"logs": [],
"receipt_ids": [
"JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
],
"gas_burnt": 209824625000,
"tokens_burnt": "20982462500000000000",
"executor_id": "bumbleee99.near",
"status": {
"SuccessReceiptId": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
},
"metadata": {
"version": 1,
"gas_profile": null
}
}
},
"receipts_outcome": [
{
"proof": [
{
"hash": "8RwCWE9HgqenPKv8JW9eg2iSLMaQW82wvebYSfjPbdTY",
"direction": "Left"
},
{
"hash": "E4VXdwsNj3fZCbP6y9YH3M5oZHPDcdArqU9kbZJa95Qp",
"direction": "Right"
}
],
"block_hash": "ASY6HgDUQUXUa99L7dPEfghKEnEk5SNkwQrx24u3Fobz",
"id": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ",
"outcome": {
"logs": [],
"receipt_ids": [],
"gas_burnt": 209824625000,
"tokens_burnt": "20982462500000000000",
"executor_id": "bumbleee99.near",
"status": {
"SuccessValue": ""
},
"metadata": {
"version": 1,
"gas_profile": []
}
}
}
],
"receipts": []
},
"id": "2"
}
You could see that both transaction_outcome.outcome.receipt_ids and transaction_outcome.outcome.status are pointing to a receipt with ID JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ. I've tried querying node about this receipt with EXPERIMENTAL_receipt method like this
{
"jsonrpc": "2.0",
"id": "2",
"method": "EXPERIMENTAL_receipt",
"params": {"receipt_id": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"}
}
yet the node returns error indicating, that there is no receipt with given ID
{
"jsonrpc": "2.0",
"error": {
"name": "HANDLER_ERROR",
"cause": {
"name": "UNKNOWN_RECEIPT",
"info": {
"receipt_id": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
}
},
"code": -32000,
"message": "Server error",
"data": {
"name": "UNKNOWN_RECEIPT",
"info": {
"receipt_id": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
}
}
},
"id": "2"
}
TL;DR the receipt is a local receipt
The transaction from your example is a simple AddKey action where the sender is the receiver (remember this, it's important)
"Execute" transaction (means to convert the transaction into a Receipt)
Apply the Receipts
As the result of the conversion of the transaction into a receipt is your transaction_outcome
"outcome": {
"receipt_ids": [
"JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
],
"status": {
"SuccessReceiptId": "JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ"
},
This receipt is about to be applied and the predecessor_id and the receiver_id are equal. In nearcore such receipts are called local receipts (sir - sender-is-receiver) and those receipts are not stored in the nearcore database.
We emulate them on NEAR Indexer Framework side (that's why you can see Receipt JDnBrxh6L9KFgVUEg6U8d39rEUEmbvLQ5tZQUmJTMyFJ on the transaction details page on NEAR Explorer)
And because nearcore doesn't store such receipts in the database you got UNKNOWN_RECEIPT from the RPC.

Cannot retreive virtual card number in test mode via stripe API using Go examples

Trying to follow the example here: https://stripe.com/docs/issuing/cards/virtual
When I add params.AddExpand("number"), no number is returned, yet via the dashboard I was able to see the card numbers. Here's sample code and redacted info for the Req and Resp.
func (ac *appContext) CardRetrieve(id string) *stripe.IssuingCard {
stripe.Key = ac.Config.Stripe.SecretKey
params := stripe.IssuingCardParams{}
params.AddExpand("number")
params.AddExpand("cvc")
ic_num, _ := card.Get(id, &params)
return ic_num
}
Returns:
{
"id": "ic_redacted",
"object": "issuing.card",
"brand": "Visa",
"cancellation_reason": null,
"cardholder": {
"id": "ich_redacted",
"object": "issuing.cardholder",
"billing": {
"address": {
"city": "A Beach",
"country": "US",
"line1": "404 Main St.",
"line2": "Suite #302",
"postal_code": "19001",
"state": "DE"
}
},
"company": null,
"created": 1613338532,
"email": "redacted#notreal.com",
"individual": {
"dob": {
"day": 20,
"month": 10,
"year": 1990
},
"first_name": "User",
"last_name": "Testing",
"verification": {
"document": {
"back": null,
"front": null
}
}
},
"livemode": false,
"metadata": {
},
"name": "User Testing",
"phone_number": "+15165551212",
"requirements": {
"disabled_reason": "under_review",
"past_due": [
]
},
"spending_controls": {
"allowed_categories": [
],
"blocked_categories": [
],
"spending_limits": [
{
"amount": 1,
"categories": [
],
"interval": "daily"
}
],
"spending_limits_currency": "usd"
},
"status": "active",
"type": "individual"
},
"created": 1613338532,
"currency": "usd",
"exp_month": 1,
"exp_year": 2024,
"last4": "0088",
"livemode": false,
"metadata": {
},
"replaced_by": null,
"replacement_for": null,
"replacement_reason": null,
"shipping": null,
"spending_controls": {
"allowed_categories": null,
"blocked_categories": null,
"spending_limits": [
{
"amount": 1,
"categories": [
],
"interval": "daily"
}
],
"spending_limits_currency": "usd"
},
"status": "inactive",
"type": "virtual"
}
What confuses me is the documentation found here:
https://stripe.com/docs/issuing/cards/virtual
It says: You can retrieve both the full unredacted card number and CVC from the API. For security reasons, these fields are only available for virtual cards and will be omitted unless you explicitly request them with the expand property. Additionally, they are only available through the Retrieve a card endpoint. That links to the issue card retrieval end point, but the params defined in the virtual cards example references the CardParams{} struct.
No of the examples show what imported module their aliasing for card to exec card.Get, but it stands to reason given the flow of the documentation that this should be IssuingCardParams{} and that the card alias is referencing: "github.com/stripe/stripe-go/issuing/card"
I also find it strange that we're defining params in the example but not passing it into the card.Get()
Edit:
I went digging through the module and it seems like to get the card details you have to call: details, _ := card.Details(id, params) but I get a 404 when trying to call that. The object returned is actually the right object and I see number and cvc, albeit nil.
I get the following error:
2021/02/15 00:33:06 Request error from Stripe (status 404): {"status":404,"message":"Unrecognized request URL (GET: /v1/issuing/cards/ic_redacted/details). Please see https://stripe.com/docs
So it seems you need to include a /v72 in the import:
"github.com/stripe/stripe-go/v72"
The documentation should be updated to show this and the virtual card example for go should also be updated.

teams - graph api - can't create event with defined organizer / specify channel

I'm trying to create an event for a teams. Using the WEB interface, I can create and specify the channel. through the API, there's no channel field.
Also, When I'm specifying an organizer, it's being over writed to some other values.
What I need to do:
1-) create the event and keep the specified organizer
2-) invite all members of the channel (or specify the channel) when creating the event.
I'm following the official 1.0 API:
POST https://graph.microsoft.com/v1.0/groups/{my-id}/calendar/events
{
"subject": "TESTE - New Event - Sala virtual",
"body": {
"contentType": "HTML",
"content": "Does late morning work for you?"
},
"start": {
"dateTime": "2020-04-21T11:00:00",
"timeZone": "Pacific Standard Time"
},
"end": {
"dateTime": "2020-04-21T12:30:00",
"timeZone": "Pacific Standard Time"
},
"location":{
"displayName":"Online"
},
"attendees": [
{
"emailAddress": {
"address":"test#another.com",
"name": "Test"
},
"type": "required"
}
,
{
"emailAddress": {
"name": "Teste",
"address": "group#test.com"
},
"type": "required"
}
],
"onlineMeetingProvider":"teamsForBusiness",
"isOnlineMeeting": true,
"organizer":{
"emailAddress":{
"name":"Owner",
"address":"owner#test.com"
}
}
}

Resources