OpenAPI can't connected - node.js

I'm trying to build a API base on https://github.com/coinbase/rosetta-specifications/blob/master/api.yaml specification.
Now i have run this yaml file in openapi generator for nodejs-express-server (https://openapi-generator.tech/docs/generators/nodejs-express-server)
When i want try to access the endpoint /network/list it give me error:
{
"message": "request should have required property 'headers'",
"errors": [
{
"path": ".headers",
"message": "should have required property 'headers'",
"errorCode": "required.openapi.validation"
}
]
}
I have add the following header in postman: Content-Type: application/json (as specify in yaml file).
can anyone please let me know what i'm doing wrong?

Related

Microsoft Graph API Add "Error while adding group as a member to other group"

I am getting an error when adding a group as a member of other group using the Microsoft Graph API. It was working okay before, but now it's giving me an error.
I am using this:
POST https://graph.microsoft.com/v1.0/groups/{group-id}/members/$ref
Content-type: application/json
body:
{
"#odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{id}"
}
And I am getting this error:
{
"error": {
"code": "Request_BadRequest",
"message": "An invalid operation was included in the following modified references: 'members'.",
"innerError": {
"date": "2021-09-08T16:09:31",
"request-id": "b1f3a1d9-96ae-4f3e-9ec0-73781bed4379",
"client-request-id": "b1f3a1d9-96ae-4f3e-9ec0-73781bed4379"
}
}
}

I'm unable to Send chatMessage in a channel or a chat using Microsoft Graph API

I was just trying to access the Send chatMessage in a channel or a chat using the microsoft grah API. Also given the required permissions for the for my application both Delegant & Application level.
API Used : POST https://graph.microsoft.com/v1.0/teams/fbe2bf47-16c8-47cf-b4a5-4b9b187c508b/channels/19:4a95f7d8db4c4e7fae857bcebe0623e6#thread.tacv2/messages
Content-type: application/json
{
"body": { "content": "Hello World" }
}
Postman Response: 401
{
"error": {
"code": "Unauthorized",
"message": "Unauthorized",
"innerError": {
"date": "2021-07-16T16:34:49",
"request-id": "ddd9c7ad-f84b-423f-88fc-630330bad600",
"client-request-id": "ddd9c7ad-f84b-423f-88fc-630330bad600"
}
}
}
Graph API Explorer Response : 403
Documentation URL : https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http
Thanks in Advance.
I tried this using graph explorer and I was able to send the message.
Note : Please make sure you have the above required permissions to send the message to the channel.
Reference:
Send chatMessage in a channel or a chat - Microsoft Graph v1.0 | Microsoft Docs

DocuSign Envelopes: listStatus "UNSPECIFIED_ERROR"

I'm trying to make a API call to the eSignature REST API Envelopes: listStatus (as shown here)
However, I get ERROR 400 Bad Request and the following:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
Even trying it in DocuSign's API explorer I get the same error. The error seems to be pointing to a issue with how the request body is formed. DocuSign suggests this,
{
"envelopeIds": [
"44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15",
"8e26040d-xxxx-xxxx-xxxx-1e29b924d237",
"c8b40a2d-xxxx-xxxx-xxxx-4fe56fe10f95"
]
}
however, if I use "envelopeIds" in the body instead I get:
{
"errorCode": "INVALID_REQUEST_PARAMETER",
"message": "The request contained at least one invalid parameter. Query parameter 'from_date' must be set to a valid DateTime, or 'envelope_ids' or 'transaction_ids' must be specified."
}
replacing "envelopeIds" with "envelope_ids" I get:
Response:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
and even using a comma separated list like, I get the same error:
Body:
{ "envelopeIds": "44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15,8e26040d-xxxx-xxxx-xxxx-1e29b924d237"}
Response:
{
"errorCode": "UNSPECIFIED_ERROR",
"message": "Object reference not set to an instance of an object."
}
Any help would be much appreciated. I have tried this using both postman and DocuSign's API explorer.
You need to include ?envelope_ids=request_body in the URL.
Then it should work with the body:
{
"envelopeIds": [
"44c5ad6c-xxxx-xxxx-xxxx-ebda5e2dfe15",
"8e26040d-xxxx-xxxx-xxxx-1e29b924d237",
"c8b40a2d-xxxx-xxxx-xxxx-4fe56fe10f95"
]
}

Adding User to Group using Graph API B2C

I am using Azure AD B2C to create users.
After a user is created I would like to add them to a Group
Using Postman I have made the following request (with access token in the header). Note: I have managed to successfully create a group using the Api.
POST
https://graph.windows.net/{azure-tenant}/groups/{group-objectId/members/$ref?api-version=1.6
With Body:
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/directoryObjects/{user-objectId}"
}
Which is what the documentation specifies. No matter the body that is sent I get the following error
{
"odata.error": {
"code": "Request_BadRequest",
"message": {
"lang": "en",
"value": "The request URI is not valid. Since the segment 'members' refers to a collection, this must be the last segment in the request URI. All intermediate segments must refer to a single resource."
},
"requestId": "48cf65f3-20ba-411e-8121-f7ea54252f3a",
"date": "2019-05-27T06:09:25"
}
}
I tried removing the /$ref
POST
https://graph.windows.net/{azure-tenant}/groups/{group-objectId/members?api-version=1.6
Body:
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/directoryObjects/{user-objectId}"
}
as well as
{
"#odata.id": "https://graph.windows.net/{azure-tenant}/users/{user-objectId}"
}
Now the error that gets returned now is:
{
"odata.error": {
"code": "Request_BadRequest",
"message": {
"lang": "en",
"value": "Unsupported resource type 'DirectoryObject' for operation 'Create'."
},
"requestId": "2c36cc6d-383c-44f8-8609-2ac3e3efc862",
"date": "2019-05-27T06:15:26"
}
}
The documentation that I have been using https://learn.microsoft.com/en-us/graph/api/group-post-members?view=graph-rest-1.0&tabs=javascript
You are using graph.windows.net endpoint, so you should refer to azure ad graph api.
POST https://graph.windows.net/myorganization/groups/b4bda672-1fba-4711-8fb1-5383c40b2c14/$links/members?api-version=1.6
{
"url": "https://graph.windows.net/myorganization/directoryObjects/3eb6055a-baeb-44d4-a1ea-2fee86d8891b"
}
The document you referred to is microsoft graph api. The endpoint should be https://graph.microsoft.com.
You can use Microsoft Graph explorer to call these apis.

creating subscription with Microsoft Graph API error

I'm trying to create a subscription to receive notification about changes to Office365 Calendar. I have already worked with Outlook Notitication API but having a problem with Microsoft Grap API
I try to create a subscription using Http Post to https://graph.microsoft.com/beta/subscriptions with header and body:
Header: Content-Type: application/json; Authorization : Bearer {accessToke}
Body:
{
"resource": "me/calendars",
"notificationUrl": "sample notification url",
"changeType": "Created",
}
In my notification url, i've setup to send a response with the value of validation token when receveving a validation request
Finally, the result i received:
{
"error": {
"code": "ExtensionError",
"message": "There was an error processing a storage extension.",
"innerError": {
"request-id": "6c563931-511d-415d-9c04-c07f25d45b1f",
"date": "2016-03-20T08:10:32"
}
}
}
I wonder what I'm doing wrong or that's a internal error of MS Grap API. Can anyone help me? Thank in advance
The correct resource to use for calendar events is "me/events". We'll try to get a better error message in future.

Resources