Can anyone tell me what the difference is between the status table and the stream table?
I am querying my own posts using the graph explorer and I find some status updates appear only in the status table, and others appear in both the stream and status table. When I go to my own Timeline I can see posts from both tables.
What is going on here? Why are some in the posts table only, but appear on my Timeline?!
I am trying to find a list of all my posts that are publicly visible, and it seems to do this I need to query both tables and end up with some duplicates. Is there a better way?
Here is an example:
graph.facebook.com/10150680671412355
{
"id": "10150680671412355",
"from": {
"name": "Alan Byrne",
"id": "509517354"
},
"message": "Beans on toast.",
"updated_time": "2012-03-14T10:53:01+0000",
"likes": {
"data": [
{
"id": "xxxxx",
"name": "xxxx"
}
],
"paging": {
"next": "https://graph.facebook.com/10150680671412355/likes?method=GET&metadata=true&format=json&callback=___GraphExplorerAsyncCallback___&access_token=AAACEdEose0cBAPjaO9gCyMZA2TT5hRE7iEkgmksfpNneFdtshFDfp0oM3hiX6I57vUkzGZAyXW5c9YaM1WQFUxt2zTZCden7zTAlbMSDAZDZD&limit=25&offset=25&__after_id=100001368900242"
}
},
"comments": {
"data": [
{
"id": "10150680671412355_31516486",
"from": {
"name": "xxxxx",
"id": "xxxxx"
},
"message": "Peasant. Baked beans on the other hand...",
"can_remove": true,
"created_time": "2012-03-14T11:20:35+0000"
}
],
"paging": {
"next": "https://graph.facebook.com/10150680671412355/comments?method=GET&metadata=true&format=json&callback=___GraphExplorerAsyncCallback___&access_token=AAACEdEose0cBAPjaO9gCyMZA2TT5hRE7iEkgmksfpNneFdtshFDfp0oM3hiX6I57vUkzGZAyXW5c9YaM1WQFUxt2zTZCden7zTAlbMSDAZDZD&limit=25&offset=25&__after_id=10150680671412355_31516486"
}
},
"type": "status"
}
Yet, when I scan for posts on the stream on that same day, this one does not come back
fql?q=select message,post_id,created_time from stream where source_id=509517354 and created_time > 1331596800 and created_time < 1331856000
{
"data": [
{
"message": "",
"post_id": "509517354_10150680640782355",
"created_time": 1331720877
},
{
"message": "",
"post_id": "509517354_10150680632467355",
"created_time": 1331720499
},
{
"message": "MY COMPUTER DOES NOT HAVE VIRUSES! STOP CALLING ME! ARGH!",
"post_id": "509517354_10150680618357355",
"created_time": 1331719866
},
{
"message": "",
"post_id": "509517354_10150680602327355",
"created_time": 1331719906
},
{
"message": "I did it!",
"post_id": "509517354_10150680491832355",
"created_time": 1331716355
},
{
"message": "",
"post_id": "509517354_10150680446052355",
"created_time": 1331714440
},
{
"message": "It got to Australia.\n",
"post_id": "509517354_365689393454249",
"created_time": 1331679835
},
{
"message": "",
"post_id": "509517354_107999992664739",
"created_time": 1331677643
},
{
"message": "",
"post_id": "509517354_10150678888762355",
"created_time": 1331671872
},
{
"message": "Booooo",
"post_id": "509517354_268316116580687",
"created_time": 1331632096
},
{
"message": "'spose I should wander into the office...",
"post_id": "509517354_10150678259167355",
"created_time": 1331625013
},
{
"message": "",
"post_id": "509517354_10150678258862355",
"created_time": 1331624991
},
{
"message": "",
"post_id": "509517354_10150678257547355",
"created_time": 1331624907
},
{
"message": "",
"post_id": "509517354_10150678250602355",
"created_time": 1331631742
}
]
}
The stream contains posts of various types - links, checkins, photos and status updates.
The status table only contains status updates - text with no additional links, photos etc.
If you're hoping to find the content similar to the timeline, you'll want to use the stream table.
Related
My goal is to display the 6 most recent items in the current users OneDrive.
Using https://graph.microsoft.com/v1.0/me/drive/recent?top=6 gives me the correct documents.
Some of these documents are OneNote Items.
At www.office.com the OneNote Items are displayed with the Notebook's displayname.
In the API response only the filename is contained.
Testing this is Microsoft's example data here:
https://developer.microsoft.com/en-us/graph/graph-explorer
Example response
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"#odata.nextLink": "https://graph.microsoft.com/v1.0/me/drive/recent?top=6&expand=section&$skiptoken=s!Njs3NGI0MzJjYS1mNmIzLTQ5YmQtOWIxMC02OTIyNjRlMTI3YTI",
"value": [
...
{
"#odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"size": 55782,
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"remoteItem": {
"createdDateTime": "2017-08-07T16:08:45Z",
"id": "01BYE5RZ2IKLBQXYXELFD23BMJIB545TH6",
"lastModifiedDateTime": "2020-01-09T03:02:37Z",
"name": "Fabrikam.one",
"size": 55782,
"webDavUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/Documents/Fabrikam.one",
"webUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com/_layouts/15/Doc.aspx?sourcedoc=%7B0BC35248-E4E2-4759-AD85-89407BCECCFE%7D&file=Fabrikam.one&action=edit&mobileredirect=true&wdorigin=Sharepoint&DefaultItemOpen=1",
"createdBy": {
"user": {
"email": "MeganB#M365x214355.onmicrosoft.com",
"displayName": "Megan Bowen"
}
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2017-08-07T16:08:45Z",
"lastModifiedDateTime": "2020-01-09T03:02:37Z"
},
"lastModifiedBy": {
"user": {
"email": "",
"displayName": "System Account"
}
},
"parentReference": {
"driveType": "business",
"driveId": "b!-RIj2DuyvEyV1T4NlOaMHk8XkS_I8MdFlUCq1BlcjgmhRfAj3-Z8RY2VpuvV_tpd",
"id": "01BYE5RZ56Y2GOVW7725BZO354PWSELRRZ"
},
"shared": {
"scope": "users"
},
"sharepointIds": {
"listId": "23f045a1-e6df-457c-8d95-a6ebd5feda5d",
"listItemId": "36",
"listItemUniqueId": "0bc35248-e4e2-4759-ad85-89407bceccfe",
"siteId": "d82312f9-b23b-4cbc-95d5-3e0d94e68c1e",
"siteUrl": "https://m365x214355-my.sharepoint.com/personal/meganb_m365x214355_onmicrosoft_com",
"webId": "2f91174f-f0c8-45c7-9540-aad4195c8e09"
}
}
},
...
]
}
Is there a way to retrieve the OneNote notebook's name from here?
The API provides a way to retrieve all notebooks like so:
https://graph.microsoft.com/v1.0/me/onenote/notebooks
However I do not see a connection between these responses.
Maybe relevant how to find OneNote Notebook object from driveItem with MS Graph? - this shows a workaround. I am curious if there is a better solution.
Is it possible to get the List of all pull request with the details like the date when it was raised, the Person who raised it and the list of all the approvers from the BITBUCKET SERVER using the REST APIs
Absolutely, You can fetch the list of Pull requests along with all the other details like who raised it, when it was raised and who are the reviewers using the following API,
https://docs.atlassian.com/bitbucket-server/rest/7.4.0/bitbucket-rest.html#idp285
You will have the following as response,
{
"size": 1,
"limit": 25,
"isLastPage": true,
"values": [
{
"id": 101,
"version": 1,
"title": "Talking Nerdy",
"description": "It’s a kludge, but put the tuple from the database in the cache.",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1359075920,
"updatedDate": 1359085920,
"fromRef": {
"id": "refs/heads/feature-ABC-123",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"toRef": {
"id": "refs/heads/master",
"repository": {
"slug": "my-repo",
"name": null,
"project": {
"key": "PRJ"
}
}
},
"locked": false,
"author": {
"user": {
"name": "tom",
"emailAddress": "tom#example.com",
"id": 115026,
"displayName": "Tom",
"active": true,
"slug": "tom",
"type": "NORMAL"
},
"role": "AUTHOR",
"approved": true,
"status": "APPROVED"
},
"reviewers": [
{
"user": {
"name": "jcitizen",
"emailAddress": "jane#example.com",
"id": 101,
"displayName": "Jane Citizen",
"active": true,
"slug": "jcitizen",
"type": "NORMAL"
},
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"role": "REVIEWER",
"approved": true,
"status": "APPROVED"
}
],
"participants": [
{
"user": {
"name": "dick",
"emailAddress": "dick#example.com",
"id": 3083181,
"displayName": "Dick",
"active": true,
"slug": "dick",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": false,
"status": "UNAPPROVED"
},
{
"user": {
"name": "harry",
"emailAddress": "harry#example.com",
"id": 99049120,
"displayName": "Harry",
"active": true,
"slug": "harry",
"type": "NORMAL"
},
"role": "PARTICIPANT",
"approved": true,
"status": "APPROVED"
}
],
"links": {
"self": [
{
"href": "http://link/to/pullrequest"
}
]
}
}
],
"start": 0 }
I created a SharePoint Page in SitePages library using the new SharePoint online experience. The page was created and I tried to fetch the page properties using MS Graph endpoint:
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/site_page.aspx?expand=listItem
The response I got:
{
...
"name": "site_page.aspx",
...
"file": {
"mimeType": "application/xml",
"hashes": {
"quickXorHash": ""
}
},
...
"listItem": {
...
"id": "4",
...
"contentType": {
"id": "0x0101009D1CB255DA76424F860D91F20E6C411800020BAE24978F3545AFD24007B325ACF9"
},
"fields": {
"FileLeafRef": "site_page.aspx",
"Title": "site_page",
"LinkTitle": "site_page",
"id": "4",
"ContentType": "Site Page",
...
}
}
}
Then I added Wiki Page content to this library to support Wiki pages in my site.
I created a new Wiki Page and fetched the page properties again using MS Graph endpoint:
https://graph.microsoft.com/v1.0/drives/{drive-id}/root:/wiki_page.aspx?expand=listItem
The response I got:
{
...
"name": "wiki_page.aspx",
...
"file": {
"mimeType": "application/xml"
},
...
"listItem": {
...
"id": "5",
...
"contentType": {
"id": "0x0101009D1CB255DA76424F860D91F20E6C411800020BAE24978F3545AFD24007B325ACF9"
},
"fields": {
"FileLeafRef": "wiki_page.aspx",
"Title": "wiki_page",
"LinkTitle": "wiki_page",
"id": "5",
"ContentType": "Site Page",
"WikiField" : "..."
...
}
}
}
As you can see both items have the same Content Type. How that is possible?
The only difference being that the wiki_page Item doesn't include 'hashes' property and does include 'WikiField' property (the place where the wiki page content is stored).
Is there another way to distinguish page types?
You could try this endpoint: GET /sites/{site-id}/lists/{list-id}/items?expand=fields(select= ContentType)
My test result:
{
"#odata.etag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"createdDateTime": "2020-04-22T05:34:06Z",
"eTag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"id": "11",
"lastModifiedDateTime": "2020-04-22T05:34:06Z",
"webUrl": "https://xxxx.sharepoint.com/sites/dev/SitePages/wikipage.aspx",
"createdBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"lastModifiedBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"parentReference": {
"id": "79e13173-d5ee-4a17-a081-5c94d148f905",
"siteId": "xxxx.sharepoint.com,b57886ef-4c2a-4d56-ad29-27266638ac3b,b62d1450-8e6f-4be7-84a3-f6600fd6cc14"
},
"contentType": {
"id": "0x01010800511BB12BD4FB664A89516226DBDDF1FB"
},
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('11')/fields/$entity",
"fields": {
"#odata.etag": "\"b3b04ace-40cd-4847-a3d8-678bc658216d,2\"",
"ContentType": "Wiki Page"
}
},
{
"#odata.etag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"createdDateTime": "2020-04-22T05:35:54Z",
"eTag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"id": "12",
"lastModifiedDateTime": "2020-04-22T05:35:54Z",
"webUrl": "https://xxxx.sharepoint.com/sites/dev/SitePages/webpartpage.aspx",
"createdBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"lastModifiedBy": {
"user": {
"email": "amos#xxxx.onmicrosoft.com",
"id": "fc1e9add-6f9c-4b95-83e1-a022441681d7",
"displayName": "test"
}
},
"parentReference": {
"id": "79e13173-d5ee-4a17-a081-5c94d148f905",
"siteId": "xxxx.sharepoint.com,b57886ef-4c2a-4d56-ad29-27266638ac3b,b62d1450-8e6f-4be7-84a3-f6600fd6cc14"
},
"contentType": {
"id": "0x0101090100FAC6DAD225005749BE7D6124B50B156E"
},
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('12')/fields/$entity",
"fields": {
"#odata.etag": "\"70f12845-7646-4b2b-85bd-4a8074c105a0,1\"",
"ContentType": "Web Part Page"
}
}
You'd better check the type of your page.
Updatded:
"fields#odata.context": "https://graph.microsoft.com/v1.0/$metadata#sites('siteid')/lists('63307f0b-bc1c-4372-bfea-6352ed57a0ff')/items('13')/fields/$entity"
"fields": {
"#odata.etag": "\"18361706-416b-4a71-8d31-bce87c1a57e4,3\"",
"ContentType": "Site Page"
}
Have an MS Flow trying to call the Graph API to update a user's profile photo. It takes a username and jpg photo file and then calls an HTTP connection secured using Azure AD (with https://graph.microsoft.com as the resource URI). Unfortunately, I get the error The file you chose isn't an image. Please choose a different file. which seems to indicate that I am not posting the file encoded in a way that MS Graph recognizes.
I've tried all variations I can think of with the body (using the #binary, #base64ToBinary, etc):
"body": "#{triggerBody()?['file']?['contentBytes']}"
to try to get it to treat "correctly", but with no luck.
This is the full flow definition:
{
"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
},
"$authentication": {
"defaultValue": {},
"type": "SecureObject"
}
},
"triggers": {
"manual": {
"type": "Request",
"kind": "Button",
"inputs": {
"schema": {
"type": "object",
"properties": {
"file": {
"title": "Photo",
"type": "object",
"x-ms-dynamically-added": true,
"description": "Please select file or image",
"x-ms-content-hint": "FILE",
"properties": {
"name": {
"type": "string"
},
"contentBytes": {
"type": "string",
"format": "byte"
}
}
},
"text": {
"title": "Username",
"type": "string",
"x-ms-dynamically-added": true,
"description": "user#domain.com",
"x-ms-content-hint": "TEXT"
}
},
"required": [
"text"
]
}
}
}
},
"actions": {
"Invoke_an_HTTP_request": {
"runAfter": {},
"metadata": {
"flowSystemMetadata": {
"swaggerOperationId": "InvokeHttp"
}
},
"type": "ApiConnection",
"inputs": {
"host": {
"connection": {
"name": "#json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$connections']['webcontents_1']['connectionId']"
}
},
"method": "post",
"body": {
"method": "PUT",
"url": "https://graph.microsoft.com/v1.0/users/#{triggerBody()['text']}/photo/$value",
"headers": {
"Content-Type": "image/jpeg"
},
"body": "#{triggerBody()?['file']?['contentBytes']}"
},
"path": "/codeless/InvokeHttp",
"authentication": {
"type": "Raw",
"value": "#json(decodeBase64(triggerOutputs().headers['X-MS-APIM-Tokens']))['$ConnectionKey']"
}
}
}
}
}
and the full error:
{
"error": {
"code": 502,
"message": "{\r\n \"error\": {\r\n \"code\": 502,\r\n \"source\": \"unitedstates-002.azure-apim.net\",\r\n \"clientRequestId\": \"e105d9f2-af13-4a5b-8fbd-c84c49cadc8f\",\r\n \"message\": \"BadGateway\",\r\n \"innerError\": {\r\n \"error\": {\r\n \"code\": \"ErrorInternalServerError\",\r\n \"message\": \"An internal server error occurred. The operation failed., The file you chose isn't an image. Please choose a different file.\",\r\n \"innerError\": {\r\n \"request-id\": \"e3214f20-8592-4fb0-9d34-677322b231ae\",\r\n \"date\": \"2019-07-30T21:42:10\"\r\n }\r\n }\r\n }\r\n }\r\n}"
}
}
I created a bill through the QuickBooks Online (QBO) web UI. Then I queried using the API (v3, documented here). The response:
{
"SyncToken": "16",
"domain": "QBO",
"VendorRef": {
"name": "MyVendor",
"value": "237"
},
"TxnDate": "2014-12-07",
"TotalAmt": 1.83,
"CurrencyRef": {
"name": "United States Dollar",
"value": "USD"
},
"PayType": "Check",
"PrivateNote": "test billpayment description (mod)",
"sparse": false,
"Line": [
{
"Amount": 1.22,
"LinkedTxn": [
{
"TxnId": "1412",
"TxnType": "Bill"
}
]
}
],
"Id": "1413",
"CheckPayment": {
"PrintStatus": "NeedToPrint",
"BankAccountRef": {
"name": "MyBankAcct#1234",
"value": "137"
}
},
"MetaData": {
"CreateTime": "2014-12-07T18:44:51-08:00",
"LastUpdatedTime": "2014-12-10T20:20:28-08:00"
}
}
As you can see, it has $0.61 of the TotalAmt unapplied to any Bills. (The other $1.22 is applied to Bill 1412.) Now, when I try to update this bill to change JUST the amount applied to the linked transaction, I get unexpected results.
Here's the update request body:
{
"SyncToken": "16",
"domain": "QBO",
"VendorRef": {
"name": "MyVendor",
"value": "237"
},
"TxnDate": "2014-12-07",
"TotalAmt": 1.83,
"CurrencyRef": {
"name": "United States Dollar",
"value": "USD"
},
"PayType": "Check",
"PrivateNote": "test billpayment description (mod)",
"sparse": false,
"Line": [
{
"Amount": 1.21,
"LinkedTxn": [
{
"TxnId": "1412",
"TxnType": "Bill"
}
]
}
],
"Id": "1413",
"CheckPayment": {
"PrintStatus": "NeedToPrint",
"BankAccountRef": {
"name": "MyBankAcct#1234",
"value": "137"
}
},
"MetaData": {
"CreateTime": "2014-12-07T18:44:51-08:00",
"LastUpdatedTime": "2014-12-10T20:20:28-08:00"
}
}
In the response, it appears that the API just basically can't handle the situation (even though it clearly existed when I created it in the web UI). Look what happens to the TotalAmt attribute! It's reduced to whatever the payment was in the LinkedTxn:
{
"BillPayment": {
"VendorRef": {
"value": "237",
"name": "MyVendor"
},
"PayType": "Check",
"CheckPayment": {
"BankAccountRef": {
"value": "137",
"name": "MyBankAcct#1234"
},
"PrintStatus": "NeedToPrint"
},
"TotalAmt": 1.21,
"domain": "QBO",
"sparse": false,
"Id": "1413",
"SyncToken": "17",
"MetaData": {
"CreateTime": "2014-12-07T18:44:51-08:00",
"LastUpdatedTime": "2014-12-10T20:25:02-08:00"
},
"TxnDate": "2014-12-07",
"CurrencyRef": {
"value": "USD",
"name": "United States Dollar"
},
"PrivateNote": "test billpayment description (mod)",
"Line": [
{
"Amount": 1.21,
"LinkedTxn": [
{
"TxnId": "1412",
"TxnType": "Bill"
}
]
}
]
},
"time": "2014-12-10T20:25:01.91-08:00"
}
I don't see discussion of this on the known issues page, so I'm pretty confused.
If you have any suggestions as to how to get this to do what I want it to, I thank you for your thoughts!