Not able to see Screen Name data (firebase_screen_name or firebase_screen) on the result of the BigQuery - events

I was trying to use the Screen name data in order to perform some queries on BigQuery related to Firebase Events Analytics.
In order to do that, I've tried to check that the data exists on the result of the BigQuery.
I've added this into app, in order to manually log the screen name and screen class:
Analytics.logEvent(AnalyticsEventScreenView,
parameters: [AnalyticsParameterScreenName: "name_xyz",
AnalyticsParameterScreenClass: "XActivity"])
I've done some query like this:
SELECT *
FROM `project.analytics_000000000.events_20220608`
WHERE
event_name = 'screen_view'
and platform = 'ANDROID'
and (
event_params[OFFSET(0)].key = "firebase_screen_class"
and event_params[OFFSET(0)].value.string_value = "XActivity"
)
One result entry example:
{
"event_date": "20220608",
"event_timestamp": "123456",
"event_name": "screen_view",
"event_params": [{
"key": "firebase_screen_class",
"value": {
"string_value": "XActivity",
"int_value": null,
"float_value": null,
"double_value": null
}
}, {
"key": "engaged_session_event",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null
}
}, {
"key": "firebase_previous_id",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null
}
}, {
"key": "firebase_event_origin",
"value": {
"string_value": "?",
"int_value": null,
"float_value": null,
"double_value": null
}
}, {
"key": "ga_session_id",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null
}
}, {
"key": "firebase_previous_class",
"value": {
"string_value": "YActivity",
"int_value": null,
"float_value": null,
"double_value": null
}
}, {
"key": "firebase_screen_id",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null
}
}, {
"key": "ga_session_number",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null
}
}
],
"event_previous_timestamp": "?",
"event_value_in_usd": "?",
"event_bundle_sequence_id": "?",
"event_server_timestamp_offset": "?",
"user_id": null,
"user_pseudo_id": "?",
"privacy_info": {
"analytics_storage": "?",
"ads_storage": "?",
"uses_transient_token": "?"
},
"user_properties": [{
"key": "ga_session_number",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null,
"set_timestamp_micros": "?"
}
}, {
"key": "first_open_time",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null,
"set_timestamp_micros": "?"
}
}, {
"key": "ga_session_id",
"value": {
"string_value": null,
"int_value": "?",
"float_value": null,
"double_value": null,
"set_timestamp_micros": "?"
}
}
],
"user_first_touch_timestamp": "?",
"user_ltv": "?",
"device": {
"category": "?",
"mobile_brand_name": "?",
"mobile_model_name": "?",
"mobile_marketing_name": "?",
"mobile_os_hardware_model": "?",
"operating_system": "?",
"operating_system_version": "?",
"vendor_id": "?",
"advertising_id": "?",
"language": "?",
"is_limited_ad_tracking": "?",
"time_zone_offset_seconds": "?",
"browser": "?",
"browser_version": "?",
"web_info": "?"
},
"geo": {
"continent": "?",
"country": "?",
"region": "?",
"city": "?",
"sub_continent": "?",
"metro": "?"
},
"app_info": {
"id": "?",
"version": "?",
"install_store": "?",
"firebase_app_id": "?",
"install_source": "?"
},
"traffic_source": {
"name": "?",
"medium": "?",
"source": "?"
},
"stream_id": "?",
"platform": "?",
"event_dimensions": "?",
"ecommerce": "?",
"items": []
}
So no data like below:
"event_params": [{
"key": "firebase_screen_name",
"value": {
"string_value": "name_xyz",
"int_value": null,
"float_value": null,
"double_value": null
}
}
or
"event_params": [{
"key": "firebase_screen",
"value": {
"string_value": "name_xyz",
"int_value": null,
"float_value": null,
"double_value": null
}
}
Could someone help, what am I missing?
As I can see the Screen names on Google Analytics console, somehow Google is getting this info from somewhere.
Thanks.

You don't know the order of the screen key in the event_params array. So instead of accessing offset(0), it's better to search for it in the array.
SELECT *
FROM `project.analytics_000000000.events_20220608`
WHERE
event_name = 'screen_view'
and platform = 'ANDROID'
and (
select count(*)
from unnest(event_params) as param
where key = "firebase_screen_class"
and value.string_value = "XActivity"
) > 0

Related

Ajax success returns "undefined" in asp.net core

I'm trying to get the json data by ajax and show them in the view. The data is correct in action method but when I want to show the data in table all the s are showed as undefined and so many rows that I know I don't have this much rows .maybe it is because of for loop and each loop but I really don't know how to fix it.
This is the json data:
{
"$id": "1",
"$values": [
{
"$id": "2",
"TicketId": 32,
"Author": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"To": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Status": 1,
"priority": 2,
"TrackingCode": "1bbdd10553634f2fbab1769cbf0b1b44",
"CreateDate": "2021-04-04T10:10:35.5043873",
"IsPrivate": true,
"IsDeleted": false,
"User": null,
"ApplicationRole": {
"$id": "3",
"Title": "\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06CC\u0633",
"Description": null,
"IsDelete": false,
"CreateDate": "2021-03-17T12:20:46.6002855",
"EditDate": null,
"ParentId": null,
"Roles": null,
"Id": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Name": "programmer",
"NormalizedName": "PROGRAMMER",
"ConcurrencyStamp": "a76600ef-8e82-4479-915d-41ad750cad5d"
},
"Answer": null
},
{
"$id": "4",
"TicketId": 33,
"Author": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"To": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Status": 2,
"priority": 0,
"TrackingCode": "f316a0d4bf9c4014a8acce1c152a56de",
"CreateDate": "2021-04-04T10:15:09.7256989",
"IsPrivate": false,
"IsDeleted": false,
"User": null,
"ApplicationRole": {
"$ref": "3"
},
"Answer": {
"$id": "5",
"AnswerId": 6,
"TicketId": 33,
"UserId": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"AnswerText": "\u003Cp\u003Ebbbbbb\u003C/p\u003E\r\n",
"File": null,
"DateTime": "2021-04-05T11:03:24.6079034",
"IsDeleted": false,
"Ticket": {
"$ref": "4"
},
"User": null
}
}
]
}
This is the Ajax:
<script type="text/javascript">
$(document).ready(function () {
loadData();
});
function loadData() {
$.ajax({
url: "/Ticket/GetMyTickets",
type: "Get",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (ListData) {
var str = "";
for (var i = 0; i < ListData.length; i++) {
$.each(ListData[i], function (index, items) {
str += "<tr>";
str += "<td>" + ListData[i].Status + "</td>";
str += "<td>" + ListData[i].priority + "</td>";
str += "<td>" + ListData[i].TrackingCode + "</td>";
str += "<td>" + ListData[i].CreateDate + "</td>";
str += "<td>" + ListData[i].IsPrivate + "</td>";
str += "<td>" + ListData[i].To + "</td>";
str += "<td><a onclick=Edit(this) data-toggle='modal' data-
target='#myModal'>نمایش پاسخ ها</a></td>";
str += "</tr>";
},
BodyData.innerHTML = str);
$(".TblData tr").fadeIn(1000);
};
}
});
}
I searched a lot but I didn't find any solution for the problem.
UPDATE
This is the output of console.log(ListData):
{
"$id": "1",
"$values": [
{
"$id": "2",
"TicketId": 33,
"Author": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"To": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Status": 2,
"priority": 0,
"TrackingCode": "f316a0d4bf9c4014a8acce1c152a56de",
"CreateDate": "2021-04-04T10:15:09.7256989",
"IsPrivate": false,
"IsDeleted": false,
"User": {
"$id": "3",
"FullName": "\u0645\u062F\u06CC\u0631 \u0633\u0627\u06CC\u062A",
"Avatar": "DefualtAvatar.jpg",
"IsDelete": false,
"CreateDate": "2021-03-16T13:05:20.6549686",
"EditDate": null,
"Id": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"UserName": "09876543210",
"NormalizedUserName": "09876543210",
"Email": "nikitmb2#gmail.com",
"NormalizedEmail": null,
"EmailConfirmed": false,
"PasswordHash":
"AQAAAAEAACcQAAAAEFbvXk/J1tXDz/
gAkIwWVjGWwSCeVhRgpPM0PVaRt1NJ1xlNr8HhxtMNWgd2u40BQw==",
"SecurityStamp": "IELKDSXBF5RE3MFHN7CNVOIGWWMK4QAV",
"ConcurrencyStamp": "517cf6f0-2f41-44a6-9a99-9512e0ffc471",
"PhoneNumber": "09876543210",
"PhoneNumberConfirmed": false,
"TwoFactorEnabled": false,
"LockoutEnd": null,
"LockoutEnabled": true,
"AccessFailedCount": 0
},
"ApplicationRole": {
"$id": "4",
"Title": "\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06CC\u0633",
"Description": null,
"IsDelete": false,
"CreateDate": "2021-03-17T12:20:46.6002855",
"EditDate": null,
"ParentId": null,
"Roles": null,
"Id": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Name": "programmer",
"NormalizedName": "PROGRAMMER",
"ConcurrencyStamp": "a76600ef-8e82-4479-915d-41ad750cad5d"
},
"Answer": {
"$id": "5",
"AnswerId": 6,
"TicketId": 33,
"UserId": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"AnswerText": "\u003Cp\u003Ebbbbbb\u003C/p\u003E\r\n",
"File": null,
"DateTime": "2021-04-05T11:03:24.6079034",
"IsDeleted": false,
"Ticket": {
"$ref": "2"
},
"User": {
"$ref": "3"
}
}
}
]
}
According to your json structure you only need one loop to iterate through your json array . So, simply use ListData["$values"] inside $.each and then get respective value using keyname.
Demo Code :
//just for demo
var ListData = {
"$id": "1",
"$values": [{
"$id": "2",
"TicketId": 32,
"Author": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"To": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Status": 1,
"priority": 2,
"TrackingCode": "1bbdd10553634f2fbab1769cbf0b1b44",
"CreateDate": "2021-04-04T10:10:35.5043873",
"IsPrivate": true,
"IsDeleted": false,
"User": null,
"ApplicationRole": {
"$id": "3",
"Title": "\u0628\u0631\u0646\u0627\u0645\u0647 \u0646\u0648\u06CC\u0633",
"Description": null,
"IsDelete": false,
"CreateDate": "2021-03-17T12:20:46.6002855",
"EditDate": null,
"ParentId": null,
"Roles": null,
"Id": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Name": "programmer",
"NormalizedName": "PROGRAMMER",
"ConcurrencyStamp": "a76600ef-8e82-4479-915d-41ad750cad5d"
},
"Answer": null
},
{
"$id": "4",
"TicketId": 33,
"Author": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"To": "f956d006-72b7-4a4c-b5cf-9354d6e6f193",
"Status": 2,
"priority": 0,
"TrackingCode": "f316a0d4bf9c4014a8acce1c152a56de",
"CreateDate": "2021-04-04T10:15:09.7256989",
"IsPrivate": false,
"IsDeleted": false,
"User": null,
"ApplicationRole": {
"$ref": "3"
},
"Answer": {
"$id": "5",
"AnswerId": 6,
"TicketId": 33,
"UserId": "5aff2283-5e71-4b10-a809-7c0235ccc18d",
"AnswerText": "\u003Cp\u003Ebbbbbb\u003C/p\u003E\r\n",
"File": null,
"DateTime": "2021-04-05T11:03:24.6079034",
"IsDeleted": false,
"Ticket": {
"$ref": "4"
},
"User": null
}
}
]
}
$(document).ready(function() {
loadData();
});
function loadData() {
/* $.ajax({
url: "/Ticket/GetMyTickets",
type: "Get",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(ListData) {*/
var str = "";
//get values array
$.each(ListData["$values"], function(index, items) {
//use items.nameofkey
str += "<tr>";
str += "<td>" + items.Status + "</td>";
str += "<td>" + items.priority + "</td>";
str += "<td>" + items.TrackingCode + "</td>";
str += "<td>" + items.CreateDate + "</td>";
str += "<td>" + items.IsPrivate + "</td>";
str += "<td>" + items.To + "</td>";
str += "<td><a href='#' onclick='Edit(this)' data-toggle='modal' data-target='#myModal'> نمایش پاسخ ها </a></td> ";
str += "</tr>";
});
$(".TblData").html(str)
$(".TblData").fadeIn(1000);
/* };
}
});*/
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table border="1">
<tbody class="TblData"></tbody>
</table>

How to get the total page number for pagination

I try to make my pageable data for weeks everything works but I would like to know the total number of pagination pages here are the data of my mongonDB.
{
"content": [
{
"mame": "iPhone X",
"eategory": "High-Tech",
"productId": "aDPXF7Xq",
"details": {
"vating": "00",
"stocks": "20",
"price": "800000",
"tags": [
{
"tagsl": "Apple",
"tags2": "aull",
"tags3": null
}
],
"brand": "Apple",
"description": "Iphone xX",
"picture": [
{
"picturel": "photol",
"picture2": null,
"picture3": null,
"picture4": null,
"picture5": null
}
],
"thumbnails": [
{
"thumbnaill": "thumbails 1",
"thumbnail2": null,
"thumbnail3": null,
"thumbnail4": null,
"thumbnail5": null
}
]
}
},
{
"mame": "iPhone X",
"eategory": "High-Tech",
"productId": "cjjVqOBk",
"details": {
"rating": "10",
"stocks": "20",
"price": "800000",
"tags": [
{
"tagsl": "Apple",
"tags2": "aull",
"tags3": null
}
],
"brand": "Apple",
"description": "Iphone xX",
"picture": [
{
"picturel": "photol",
"picture2": null,
"picture3": null,
"picture4": null,
"picture5": null
}
],
"thumbnails": [
{
"thumbnaill": "thumbails 1",
"thumbnail2": null,
"thumbnail3": null,
"thumbnail4": null,
"thumbnail5": null
}
]
}
},
{
"mame": "iPhone X",
"eategory": "High-Tech",
"productId": "LhKiRGr6",
"details": {
"vating": "10",
"stocks": "20",
"price": "800000",
"tags": [
{
"tagsl": "Apple",
"tags2": "aull",
"tags3": null
}
],
"brand": "Apple",
"description": "Iphone xX",
"picture": [
{
"picturel": "photol",
"picture2": null,
"picture3": null,
"picture4": null,
"picture5": null
}
],
"thumbnails": [
{
"thumbnaill": "thumbails 1",
"thumbnail2": null,
"thumbnail3": null,
"thumbnail4": null,
"thumbnail5": null
}
]
}
},
{
"mame": "iPhone X",
"eategory": "High-Tech",
"productId": "dgCvi8NJ",
"details": {
"vating": "10",
"stocks": "20",
"price": "800000",
"tags": [
{
"tagsl": "Apple",
"tags2": "aull",
"tags3": null
}
],
"brand": "Apple",
"description": "Iphone xX",
"picture": [
{
"picturel": "photol",
"picture2": null,
"picture3": null,
"picture4": null,
"picture5": null
}
],
"thumbnails": [
{
"thumbnaill": "thumbails 1",
"thumbnail2": null,
"thumbnail3": null,
"thumbnail4": null,
"thumbnail5": null
}
]
}
}
],
"pageable": {
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"offset": 0,
"pageNumber": 0,
"pageSize": 20,
"paged": true,
"unpaged": false
},
"totalPages": 1,
"totalElements": 4,
"last": true,
"size": 20,
"sort": {
"sorted": false,
"unsorted": true,
"empty": true
},
"number": 0,
"numberOfElements": 4,
"first": true,
"empty": false
}
Now here is the data paging code
#GetMapping("/engine/search")
public PageImpl<Products> engineSearch(#RequestParam("p") String query, #RequestParam(value = "page", defaultValue = "0") int page, Pageable pageable) {
Criteria criteria = new Criteria();
final Aggregation aggregation = Aggregation.newAggregation(
Aggregation.match( criteria.orOperator(
Criteria.where( "name" ).regex( query, "i" ),
Criteria.where( "details.brand" ).regex( query, "i" ),
Criteria.where( "details.tags.tags1" ).regex( query, "i" ),
Criteria.where( "details.tags.tags2" ).regex( query, "i" ),
Criteria.where( "details.tags.tags3" ).regex( query, "i" )
)),
Aggregation.skip(page * 4),
Aggregation.limit(4)
);
List<Products> filter = mongoTemplate.aggregate(aggregation, "Product", Products.class).getMappedResults();
return new PageImpl<Products>(filter, pageable, filter.size());
}
Mongodb 3.4 has introduced $facet aggregation which processes multiple aggregation pipelines within a single stage on the same set of input documents.
Using $facet and $group you can find documents with $limit and can get total count.
You can use below aggregation in mongodb 3.6
db.collection.aggregate([
{ "$facet": {
"totalData": [
{ "$match": { }},
{ "$skip": 10 },
{ "$limit": 10 }
],
"totalCount": [
{ "$count": "count" }
]
}}
])

How to get proposed time using Microsoft Graph API?

When the other person declined the meeting and proposed a new time. In Outlook, you can see the proposed time.
Now I am trying to use Microsoft Graph API to get that proposed time.
For example, the original meeting date is 2018-03-08, and the other person declined and proposed a new date 2018-03-12.
I tried
GET /beta/me/messages/{messageId}=?$expand=microsoft.graph.eventMessage/event
However, I cannot find the proposed time from the result returned. How can I get it? Thanks
{
"#odata.context": "https://graph.microsoft.com/beta/$metadata#users('576552d5-3bc0-42a6-a53d-bfceb405db23')/messages/$entity",
"#odata.type": "#microsoft.graph.eventMessage",
"#odata.etag": "W/\"DAAAABYAAACpTc/InBsuTYwTUBb+VIb4AADoRAyI\"",
"id": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgBGAAAAAACUbnk-iwQZRbXMgkfKtmYhBwCpTc-InBsuTYwTUBb_VIb4AAAAAAEMAACpTc-InBsuTYwTUBb_VIb4AADnwc8mAAA=",
"createdDateTime": "2018-03-06T22:29:10Z",
"lastModifiedDateTime": "2018-03-06T22:29:11Z",
"changeKey": "DAAAABYAAACpTc/InBsuTYwTUBb+VIb4AADoRAyI",
"categories": [],
"receivedDateTime": "2018-03-06T22:29:11Z",
"sentDateTime": "2018-03-06T22:29:05Z",
"hasAttachments": false,
"internetMessageId": "<MWHPR15MB18399806CC97C61817C9A2B18BD90#MWHPR15MB1839.namprd15.prod.outlook.com>",
"subject": "New Time Proposed: Test",
"bodyPreview": "",
"importance": "normal",
"parentFolderId": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAuAAAAAACUbnk-iwQZRbXMgkfKtmYhAQCpTc-InBsuTYwTUBb_VIb4AAAAAAEMAAA=",
"conversationId": "AAQkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgAQAOnuCMgoRLdGs-1scw6i7EU=",
"conversationIndex": "AdO1mnWL6e4IyChEt0az/WxzDqLsRQAABO5D",
"isDeliveryReceiptRequested": null,
"isReadReceiptRequested": false,
"isRead": false,
"isDraft": false,
"webLink": "https://outlook.office365.com/owa/?ItemID=AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgBGAAAAAACUbnk%2FiwQZRbXMgkfKtmYhBwCpTc%2FInBsuTYwTUBb%2BVIb4AAAAAAEMAACpTc%2FInBsuTYwTUBb%2BVIb4AADnwc8mAAA%3D&exvsurl=1&viewmodel=ReadMessageItem",
"inferenceClassification": "focused",
"unsubscribeData": [],
"unsubscribeEnabled": false,
"meetingMessageType": "meetingDeclined",
"type": "singleInstance",
"isOutOfDate": false,
"isAllDay": false,
"isDelegated": false,
"body": {
"contentType": "html",
"content": "Hi"
},
"sender": {
"emailAddress": {
"name": "Rose",
"address": "rose#example.com"
}
},
"from": {
"emailAddress": {
"name": "Rose",
"address": "rose#example.com"
}
},
"toRecipients": [
{
"emailAddress": {
"name": "Jack",
"address": "jack#example.com"
}
}
],
"ccRecipients": [],
"bccRecipients": [],
"replyTo": [],
"mentionsPreview": null,
"flag": {
"flagStatus": "notFlagged"
},
"startDateTime": {
"dateTime": "2018-03-08T04:00:00.0000000",
"timeZone": "UTC"
},
"endDateTime": {
"dateTime": "2018-03-08T05:00:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Test",
"locationType": "default",
"uniqueIdType": "unknown"
},
"recurrence": null,
"event#odata.context": "https://graph.microsoft.com/beta/$metadata#users('576552d5-3bc0-42a6-a53d-bfceb405db23')/messages('AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgBGAAAAAACUbnk-iwQZRbXMgkfKtmYhBwCpTc-InBsuTYwTUBb_VIb4AAAAAAEMAACpTc-InBsuTYwTUBb_VIb4AADnwc8mAAA%3D')/microsoft.graph.eventMessage/event/$entity",
"event": {
"#odata.etag": "W/\"qU3PyJwbLk2ME1AW/lSG+AAA6EQMeA==\"",
"id": "AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgBGAAAAAACUbnk-iwQZRbXMgkfKtmYhBwCpTc-InBsuTYwTUBb_VIb4AAAAAAENAACpTc-InBsuTYwTUBb_VIb4AADnwkmiAAA=",
"createdDateTime": "2018-03-06T22:28:32.3852279Z",
"lastModifiedDateTime": "2018-03-06T22:29:11.4604154Z",
"changeKey": "qU3PyJwbLk2ME1AW/lSG+AAA6EQMeA==",
"categories": [],
"originalStartTimeZone": "Pacific Standard Time",
"originalEndTimeZone": "Pacific Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E0080000000000000000000000000000000000000000310000007643616C2D5569640100000033324633333433392D433744452D344338362D393046452D44424639314131363444323900",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Test",
"bodyPreview": "Test",
"importance": "normal",
"sensitivity": "normal",
"isAllDay": false,
"isCancelled": false,
"isOrganizer": true,
"responseRequested": true,
"seriesMasterId": null,
"showAs": "busy",
"type": "singleInstance",
"webLink": "https://outlook.office365.com/owa/?itemid=AAMkADBlZTUwNTkxLWVmODgtNDVhNC1iZjhlLTdjNjA1ODZlMDI5MgBGAAAAAACUbnk%2FiwQZRbXMgkfKtmYhBwCpTc%2FInBsuTYwTUBb%2BVIb4AAAAAAENAACpTc%2FInBsuTYwTUBb%2BVIb4AADnwkmiAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": null,
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "Hi"
},
"start": {
"dateTime": "2018-03-08T04:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-03-08T05:00:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Test",
"locationType": "default",
"uniqueId": "Test",
"uniqueIdType": "private"
},
"locations": [
{
"displayName": "Test",
"locationType": "default",
"uniqueId": "Test",
"uniqueIdType": "private"
}
],
"recurrence": null,
"attendees": [
{
"type": "required",
"status": {
"response": "declined",
"time": "2018-03-06T22:29:05Z"
},
"emailAddress": {
"name": "Rose",
"address": "rose#example.com"
}
}
],
"organizer": {
"emailAddress": {
"name": "Jack",
"address": "jack#example.com"
}
}
}
}
The API doesn't expose this information directly. The related entities just don't have the fields defined to show this information. However, the data is obviously there, you just need to know how to get to it. The answer lies in extended properties.
Basically since Graph doesn't expose these values, we need to dig into the MAPI properties that store this data. After a little digging through the Exchange server protocol docs I found PidLidAppointmentProposedStartWhole and PidLidAppointmentProposedEndWhole. We just need to translate those MAPI property definitions into the Graph extended property syntax.
From the doc, those are both in the PSETID_Appointment namespace, which uses the GUID {00062002-0000-0000-C000-000000000046}. PidLidAppointmentProposedStartWhole uses id 0x8250, and PidLidAppointmentProposedEndWhole uses id 0x8251. So those should translate to:
PidLidAppointmentProposedStartWhole: 'SystemTime {00062002-0000-0000-C000-000000000046} Id 0x8250'
PidLidAppointmentProposedEndWhole: 'SystemTime {00062002-0000-0000-C000-000000000046} Id 0x8251'
If we use those in an $expand clause as per Get singleValueLegacyExtendedProperty, we get something like:
GET /me/mailfolders/inbox/messages?$expand=singleValueExtendedProperties($filter=id eq 'SystemTime {00062002-0000-0000-C000-000000000046} Id 0x8250' or id eq 'SystemTime {00062002-0000-0000-C000-000000000046} Id 0x8251')
And the response looks something like this (other properties omitted):
{
"subject": "New Time Proposed: Let's meet",
"singleValueExtendedProperties": [
{
"id": "SystemTime {00062002-0000-0000-c000-000000000046} Id 0x8250",
"value": "2018-03-20T20:00:00Z"
},
{
"id": "SystemTime {00062002-0000-0000-c000-000000000046} Id 0x8251",
"value": "2018-03-20T21:00:00Z"
}
]
}

Webhook from shopify with laravel 4

Using laravel to do a webhook for shopify on order creation
I specify my url in the webhook to my site.
I use postcatcher to receive the data from the webhook call so that I know what data they are passing in.
the data looks something like this
{
"customer": {
"default_address": {
"default": true,
"country_name": "Singapore",
"country_code": "SG",
"province_code": null,
"name": "Own Card",
"zip": "234567",
"province": "Singapore",
"phone": "",
"last_name": "Card",
"id": 275454813,
"first_name": "Own",
"country": "Singapore",
"company": "",
"city": "Singapore",
"address2": "",
"address1": ""
},
"last_order_name": null,
"tags": "",
"verified_email": true,
"updated_at": "2014-03-14T06:10:59-04:00",
"total_spent": "0.00",
"state": "disabled",
"orders_count": 0,
"note": null,
"multipass_identifier": null,
"last_order_id": null,
"last_name": "Koh",
"id": 219085425,
"first_name": "Kwang",
"email": "Kwang#a.com.sg",
"created_at": "2014-03-14T05:55:55-04:00",
"accepts_marketing": true
},
"client_details": {
"user_agent": "Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.146 Safari/537.36",
"session_hash": "c30217b1565a1f69ca5c1cb944ee6769c39de0f9acc8d6685975d551a2ff246f",
"browser_ip": "118.200.236.161",
"accept_language": "en-GB,en-US;q=0.8,en;q=0.6"
},
"fulfillments": [],
"shipping_address": {
"province_code": null,
"country_code": "SG",
"name": "Own Card",
"zip": "123456",
"province": "Singapore",
"phone": "12345676",
"longitude": "1.151376",
"latitude": "1.2646",
"last_name": "Card",
"first_name": "Own",
"country": "Singapore",
"company": "",
"city": "Singapore",
"address2": "",
"address1": ""
},
"billing_address": {
"province_code": null,
"country_code": "SG",
"name": "Own Card",
"zip": "312133",
"province": "Singapore",
"phone": "",
"longitude": "103.351376",
"latitude": "1.33146",
"last_name": "Card",
"first_name": "Own",
"country": "Singapore",
"company": "",
"city": "Singapore",
"address2": "",
"address1": ""
},
"payment_details": {
"credit_card_company": "Bogus",
"credit_card_number": "XXXX-XXXX-XXXX-1",
"cvv_result_code": null,
"credit_card_bin": "1",
"avs_result_code": null
},
"shipping_lines": [
{
"tax_lines": [],
"title": "Standard Shipping",
"source": "shopify",
"price": "10.00",
"code": "Standard Shipping"
}
],
"line_items": [
{
"tax_lines": [],
"product_exists": true,
"properties": [],
"variant_inventory_management": null,
"name": "test",
"vendor": "Kwang",
"variant_title": "",
"variant_id": 315650553,
"title": "test",
"taxable": true,
"sku": "1",
"requires_shipping": true,
"quantity": 1,
"product_id": 265080025,
"price": "12.00",
"id": 432417197,
"grams": 0,
"fulfillment_status": null,
"fulfillment_service": "manual"
}
],
"tags": "",
"tax_lines": [],
"checkout_id": 221740105,
"processing_method": "direct",
"note_attributes": [],
"discount_codes": [],
"order_number": 1003,
"landing_site_ref": null,
"browser_ip": "118.200.236.122",
"user_id": null,
"updated_at": "2014-03-14T06:10:59-04:00",
"total_weight": 0,
"total_tax": "0.00",
"total_price_usd": "17.37",
"total_price": "22.00",
"total_line_items_price": "12.00",
"total_discounts": "0.00",
"token": "3c71c6a830eee3b7cb0c8627e4d48e03",
"test": true,
"taxes_included": false,
"subtotal_price": "12.00",
"source_url": null,
"source_name": "web",
"source_identifier": null,
"source": "browser",
"referring_site": "",
"reference": null,
"number": 3,
"note": null,
"name": "#1003",
"location_id": null,
"landing_site": "/products/test",
"id": 244075413,
"gateway": "bogus",
"fulfillment_status": null,
"financial_status": "authorized",
"email": "kwank#a.com.sg",
"currency": "SGD",
"created_at": "2014-03-14T06:10:58-04:00",
"confirmed": true,
"closed_at": null,
"checkout_token": "95dc1ed9b867df5b1ecdf770de4eba3b",
"cart_token": "ab1795435caebccb6d96ee69f716a4c9",
"cancelled_at": null,
"cancel_reason": null,
"buyer_accepts_marketing": true
}
How do I actually access it from my php laravel function? I did something like this but when using POSTMAN to send this over i dont get anything from $c.
$inputs = Input::all();
$c = $inputs ['customer'];
Anyone can help?
It seems like you are passing the data as a json body. The code you've shown could've worked but lets try this.
First off do this:
$inputs = Input::all();
$c = $inputs->customer;
Now lets try:
$inputs = Input::json()->all();
$c = $inputs->customer;
Does it return anything?
Finally lets try:
$c = Input::get('customer');
$cd = Input::get('customer.default_address');
Based on the docs:
Some JavaScript libraries such as Backbone may send input to the application as JSON. You may access this data via Input::get like normal.
on postman you have to post that request as a json body.
Select the raw tab then change text to json... and copy paste the whole request into the textarea.
So the actual query you are looking for is:
$customer = Input::get('customer');
now you have everything that is inside the customer in $inputs.
access it like:
$default_address = $customer->default_address; // returns object
$state = $customer->state; // returns string
You can even wrap it around:
if (Request::isJson())
{
// make sure it is from a json body
}
update
try this:
$inputs = Input::all();
dd($inputs); // what does this return?

jqgrid tree reader not working

My sample Json object is shown below:
{
"o": [
{
"level": 0,
"outlineItemId": 8,
"parentItemId": null,
"parentItem": null,
"order": 0,
"text": "section 1",
"isLeaf": "false",
"expanded": "true"
},
{
"level": 1,
"outlineItemId": 9,
"parentItemId": 8,
"parentItem": {
"level": 0,
"outlineItemId": 8,
"parentItemId": null,
"parentItem": null,
"order": 0,
"text": "section 1",
"isLeaf": "false",
"expanded": "true"
},
"order": 0,
"text": "sub 1",
"isLeaf": "false",
"expanded": "true"
},
{
"level": 2,
"outlineItemId": 10,
"parentItemId": 9,
"parentItem": {
"level": 1,
"outlineItemId": 9,
"parentItemId": 8,
"parentItem": {
"level": 0,
"outlineItemId": 8,
"parentItemId": null,
"parentItem": null,
"order": 0,
"text": "section 1",
"isLeaf": "false",
"expanded": "true"
},
"order": 0,
"text": "sub 1",
"isLeaf": "false",
"negateDevice": null,
"expanded": "true"
},
"order": 0,
"text": "sub sub 1",
"isLeaf": "true",
"expanded": "true"
}
]
}
Earlier when the tree was configured as:
treeReader: {
level_field: "level",
parent_id_field: "parentItemId",
leaf_field: "isLeaf",
expanded_field: "expanded"
},
I was displaying the correct indentation and image icons, however they were not expanded when the json obj always had "expanded":"true" so i tried the below code.
treeReader: {
level_field: "o.level",
parent_id_field: "o.parentItemId",
leaf_field: "o.isLeaf",
expanded_field: "o.expanded"
},
Now I am not getting the Image icons and the tree which was expanded earlier is now flat.
My Json reader just in case i goofed up..
jsonReader: {
root: 'o',
id: 'o.outlineItemId',
parentItemId: 'o.parentItem.outlineItemId',
text: 'o.text',
repeatitems: false,
page: function(obj) { return 1; },
total: function(obj) { return 1; },
records: function(obj) { return obj.o.length; },
},
Any help will be appreciated.
Shah
Got it!
For the reader i had to include cell:'' and remove the o. references. and also loaded:true in the json object.

Resources