I am trying to create this subscription,
I have this request:
{
"changeType": "created",
"notificationUrl": "https://xxxx.ngrok.io/Chats",
"resource": "/teams/allMessages",
"expirationDateTime": "2020-09-02T20:20:46.9356913Z",
"clientState": "clienteState",
"latestSupportedTlsVersion": "v1_2",
"includeResourceData": true,
"encryptionCertificate": "{base64encodedCertificate}",
"encryptionCertificateId": "1063858CD242BF00346FF4E35E...."
}
but it returns an error
{
"error": {
"code": "InvalidRequest",
"message": "Certificate validation error: The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. ",
"innerError": {
"date": "2020-09-02T20:39:41",
"request-id": "cd73c462-3768-4283-9b6b-b7cd7a83fa0c"
}
}
}
I followed this guide to get the certificate:
"https://laurakokkarinen.com/authenticating-to-office-365-apis-with-a-certificate-step-by-step/comment-page-2/#creating-the-certificate"
I replaced characters in base 64 string.
I do not know what is my problem
Related
Sample payload:
{
"text": {
"maxLength": 1000
}
}
And my PATCH Url is
https://graph.microsoft.com/v1.0/sites/my-site-id/lists/my-list-id/columns/my-column-id
I am providing the usual headers
Accept: application/json
Content-Type: application/json
And
Authorization: Bearer Token....
I get BadRequest error
{
"error": {
"code": "invalidRequest",
"message": "One of the provided arguments is not acceptable.",
"innerError": {
"code": "badArgument",
"date": "2023-01-30T16:34:49",
"request-id": "b63137f9-fda0-41b7-9549-5952b5c89427",
"client-request-id": "b63137f9-fda0-41b7-9549-5952b5c89427"
}
}
}
I tried adding "propagateChanges": true to the payload and I get slightly different error
{
"error": {
"code": "invalidRequest",
"message": "Invalid request",
"innerError": {
"date": "2023-01-30T16:39:37",
"request-id": "41ca6541-6097-45c6-9418-d1cf57272d2c",
"client-request-id": "41ca6541-6097-45c6-9418-d1cf57272d2c"
}
}
}
Any help is appreciated.
NOTE: I am able to update for e.g. Description of the column, but not the text.maxLength property.
The maximum length of a SharePoint text field type is 255, you cannot set it to 1000. If you try setting the max length to 200 for example instead of 1000, your query should succeed.
To allow longer strings, you have to use the "note" ("multiline text") field type, not "text". This one has a limit of 63,999.
I am not sure if you can change column type using graph api (you cannot as far as I remember, but I am not 100% sure), you may need to re-create that column as "multiline", change manually, use the classic rest api instead of graph api to do it programmatically, or something like a powershell script.
If you have textColumn and allowMultipleLines is set to false then you have one line text column and the maximum length is 255.
It's not possible to change column type from one line text to multiple lines text via Graph API.
Call
PATCH https://graph.microsoft.com/v1.0/sites/my-site-id/lists/my-list-id/columns/my-column-id
{
"text": {
"allowMultipleLines": true,
"appendChangesToExistingText": false,
"linesForEditing": 6,
"textType": "plain"
}
}
Will fail.
You have to create a new column and define it as multiple lines. Define textColumn and set allowMultipleLines to true.
POST https://graph.microsoft.com/v1.0/sites/my-site-id/lists/my-list-id/columns
{
"description": "",
"displayName": "Column XXX",
"enforceUniqueValues": false,
"hidden": false,
"indexed": false,
"name": "My new multiple lines column",
"readOnly": false,
"required": false,
"text": {
"allowMultipleLines": true,
"appendChangesToExistingText": false,
"linesForEditing": 6,
"textType": "plain"
}
}
I'm getting the response with invalid JSON (brackets aren't closed) when trying to get the MS ToDo task for the user. Also, API sends HTTP status 200 with that response.
Request/response examples:
https://graph.microsoft.com/v1.0/me/todo/lists/:listID/tasks/:taskID
{
"title": "DELETED",
"createdDateTime": "2020-06-17T18:33:44.3228459Z",
"lastModifiedDateTime": "2020-11-27T11:36:55.8037415Z",
"id": "DELETED",
"linkedResources": [
{
"error": {
"code": "InternalServerError",
"message": "Invalid object within the collection response from workload for navigation property linkedResources with declaring type microsoft.graph.todoTask. Expected a JObject, but got Jtoken type - Null",
"innerError": {
"date": "2021-05-14T03:13:36",
"request-id": "5b9445b0-7405-436a-8179-cac92a8af087",
"client-request-id": "5b9445b0-7405-436a-8179-cac92a8af087"
}
}
}
How can I resolve this issue?
I'm getting an error when I call NextLink from the response of first delta.
Any ideas why it's happens?
first call:
https://graph.microsoft.com/beta/users/4ca91597-4091-4cce-856b-7472b3f9ade1/calendars/AAMkAGM3MDdhNGZlLWRjYTUtNGZkYS04NTcxLTU2OTNkZWEwNDlhYQBGAAAAAAAmh2PA4MC8QpGOM1iWfgeZBwCI_1RC5zxoQrQX6X2piZBLAAAAAAEGAACI_1RC5zxoQrQX6X2piZBLAAAAjD53AAA=/events/delta
response:
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(event)",
"#odata.nextLink": "https://graph.microsoft.com/beta/users/4ca91597-4091-4cce-856b-7472b3f9ade1/calendars/AAMkAGM3MDdhNGZlLWRjYTUtNGZkYS04NTcxLTU2OTNkZWEwNDlhYQBGAAAAAAAmh2PA4MC8QpGOM1iWfgeZBwCI_1RC5zxoQrQX6X2piZBLAAAAAAEGAACI_1RC5zxoQrQX6X2piZBLAAAAjD53AAA=/events/delta?$skiptoken=S-9EQM7OmIraj-ou9n4yBgQa6fEPxPaBcX7TFg2kKSyrl9s4t08HSSZnFF-gwy4A9E6Yg7ADWLv-z3JJ4D5p_galSKYHzmiN98EJV1ewagGy4vLP_Ccf6Ry5MQoXRx_NxwVr9hFfl2aiymXlEAMXUSGMaX9Yc7O2q6czmAFcCr_ZEL7TGy0sQqgOA7UzNZ64ocJyQRBMUjvuE19KlhqPkA.XaSRYkwmW-IAiW8ABt7Qi1gz7aHGDe2uF-m2RdF2lLM
...}
and on call NextLink I'm getting error:
{
"error": {
"code": "InvalidDeltaToken",
"message": "The value 'NCZUMk42WmtGWmFqZFdSVXh1VUVkb1EzUkNabkJtWVcxS2EwVnpRVUZPVmtWelJEQkNRVUZCUVE9PQ=='
of parameter '$deltaToken' is invalid.",
"innerError": {
"date": "2020-09-27T19:04:42",
"request-id": "6897b163-5d66-4223-8c01-ab40a0417c35",
"client-request-id": "3455e667-c7e7-9c6d-e18e-5c94c37150c8"
}
} }
UPD.1
problem with header:
rPrefer = odata.maxpagesize=50
if you are MS's developer please open ticket.
I am using POSTMAN to call Microsoft Graph APIs. I am trying to subscribe to presence for multiple users. It is mentioned in document in order to subscribe to changes to multiple user presences use this url :/communications/presences?$filter=id in ({id},{id}...)
Request Url
https://graph.microsoft.com/beta/subscriptions
So this is request body(raw)
{
"changeType": "updated",
"notificationUrl": "https://d3a8ebc3581d.ngrok.io/presence-notify/",
"resource": "/communications/presences?$filter=id in (abcd-efgh-4856-a935-c9a2f685xyz,abcd-efgh-47f8-9d79-eacb0fd6xyz)",
"expirationDateTime": "2020-09-22T07:37:13Z",
"clientState": "secretClientState"
}
I am calling this API on behalf of user i.e i am using UserAccessToken. This is Response:
{
"error": {
"code": "BadRequest",
"message": "Invalid filter clause",
"innerError": {
"date": "2020-09-21T16:24:50",
"request-id": "2cf476f0-2270-417f-a987-5c5bbc92a351",
"client-request-id": "2cf476f0-2270-417f-a987-5c5bbc92a351"
}
}
}
P.S: I have changed first few and last few characters of both the user ids. So it's not an issue.
I'm guessing this isn't documented very clearly, but if you check the filter documentation. You'll see that values actually need to have ' around them.
So if you change your request to the following it should work:
{
"changeType": "updated",
"notificationUrl": "https://d3a8ebc3581d.ngrok.io/presence-notify/",
"resource": "/communications/presences?$filter=id in ('abcd-efgh-4856-a935-c9a2f685xyz','abcd-efgh-47f8-9d79-eacb0fd6xyz')",
"expirationDateTime": "2020-09-22T07:37:13Z",
"clientState": "secretClientState"
}
I'm getting a 500 error while invoking https://graph.microsoft.com/beta/me/profile endpoint from
Graph explorer (https://developer.microsoft.com/en-us/graph/graph-explorer). When I check the network tab, I can see the error response as below. Any idea why? I tried resetting my birthdate multiple times from account.microsoft.com but that is still not fixing the timestamp & lastModifiedBy issue
{"#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/$entity","id":"profileId","addresses#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/addresses","addresses":[],"anniversaries#odata.context":"https://graph.microsoft.com/beta/$metadata#users('...')/profile/anniversaries","anniversaries":[{"type":"birthday","date":"...","allowedAudiences":"me","createdDateTime":"2020-06-30T21:52:30.364606Z","inference":null,"lastModifiedDateTime":"2020-06-30T21:52:30.364606Z"{
"error": {
"code": "InternalServerError",
"message": "The property 'lastModifiedBy[Nullable=False]' of type 'microsoft.graph.identitySet' has a null value, which is not allowed.",
"innerError": {
"date": "2020-06-30T22:15:16",
"request-id": "b9402c6b-297d-4190-a829-8297dae69d9d"
}
}
}{
"error": {
"code": "InternalServerError",
"message": "Unexpected end when deserializing object. Path 'anniversaries[0].lastModifiedDateTime', line 1, position 587.",
"innerError": {
"date": "2020-06-30T22:15:16",
"request-id": "b9402c6b-297d-4190-a829-8297dae69d9d"
}
}
}