'onlineMeetingUrl' is null after call Create Event in Graph api - outlook

I use create event api to create an event object with "onlineMeetingUrl: https://meet.lync.com/example/joyce/NLSD7Y62" but the response of "onlineMeetingUrl" is null.
Is it a bug or is there any way to create a new event with 'onlineMeetingUrl'?
Here are my test steps.
Step 1. POST /me/events
{
"#odata.etag": "W/\"BfXylo4WykyAenTZICXL5AAApUQ11g==\"",
"id": "AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA=",
"createdDateTime": "2018-03-07T02:31:20.6459109Z",
"lastModifiedDateTime": "2018-03-07T02:31:24.2554747Z",
"changeKey": "BfXylo4WykyAenTZICXL5AAApUQ11g==",
"categories": [],
"originalStartTimeZone": "Taipei Standard Time",
"originalEndTimeZone": "Taipei Standard Time",
"iCalUId": "040000008200E00074C5B7101A82E00800000000E5DACD60BCB5D301000000000000000010000000A65419D96CF4C347B8B3B5A340753291",
"reminderMinutesBeforeStart": 15,
"isReminderOn": true,
"hasAttachments": false,
"subject": "Sky Meeting",
"bodyPreview": "Join online meeting",
"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=AAMkADVmMzE2MjY0LTZkOGYtNGI4MS1iNWMxLTljYzg3MWY5MWQxMQBGAAAAAABZMfR36TVMQ6yunaqZPvVRBwAF9fKWjhbKTIB6dNkgJcvkAAAAAAENAAAF9fKWjhbKTIB6dNkgJcvkAAClFy2jAAA%3D&exvsurl=1&path=/calendar/item",
"onlineMeetingUrl": "https://meet.lync.com/example/joyce/NLSD7Y62",
"responseStatus": {
"response": "organizer",
"time": "0001-01-01T00:00:00Z"
},
"body": {
"contentType": "html",
"content": "Join online meeting"
},
"start": {
"dateTime": "2018-03-08T00:00:00.0000000",
"timeZone": "UTC"
},
"end": {
"dateTime": "2018-03-08T00:30:00.0000000",
"timeZone": "UTC"
},
"location": {
"displayName": "Online meeting"
},
"recurrence": null,
"attendees": [],
"organizer": {
"emailAddress": {
"name": "Joyce",
"address": "joyce#example.com"
}
}
}
Step 2. The onlineMeetingUrl in the response event object is null.
{
...
"onlineMeetingUrl": null,
...
}

The onlineMeetingUrl property is not writable. We will update the documentation to reflect this.

Add these params in the request body
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"

onlineMeetingUrl is null in response even while passing "isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"

Related

Need to send a single attribute from Json file as input to a http request

I have decoded a response using beanshell script and saved it in a XML file.
Beanshell Post Processor script
import org.apache.commons.io.FileUtils;
import org.apache.commons.codec.binary.Base64;
String response= vars.get("data");
vars.put("response",new String(Base64.decodeBase64(response)));
Output = vars.get("response");
f = new FileOutputStream("E:/JMeter/apache-jmeter-3.1/bin/response.xml");
p = new PrintStream(f);
this.interpreter.setOut(p);
print(Output);
f.close();
Response
{
"Username": "raghuram.k#cafyne.com",
"UserCreateDate": "2017-02-23T04:02:59.123Z",
"UserLastModifiedDate": "2017-02-23T04:04:50.695Z",
"Enabled": true,
"UserStatus": "CONFIRMED",
"sub": "50e0dff7-0342-40f1-b793-68de404d95c4",
"_app": "586cc7cc851dc874ac59f001",
"email_verified": "true",
"_org": "58adbaf2ffc4de735f1fbe28",
"name": "Raghu Ram kota",
"_groups": [
{
"_id": "58adbaf2ffc4de735f1fbe29",
"name": "default",
"slug": "default",
"description": "Default Group",
"id": "58adbaf2ffc4de735f1fbe29"
}
],
"_roles": [
{
"_id": "58adbaf2ffc4de735f1fbe2a",
"name": "ADMIN",
"slug": "admin",
"description": "ADMIN Role",
"id": "58adbaf2ffc4de735f1fbe2a"
}
],
"permissions": {
"listen": {
"DELETE": false,
"READ": true,
"UPDATE": false,
"CREATE": false
},
"profile": {
"STOPLISTEN": true,
"STARTLISTEN": true,
"AUTHORIZE": true,
"DELETE": true,
"READ": true,
"UPDATE": true,
"CREATE": true
},
"post": {
"DELETE": true,
"READ": true,
"UPDATE": true,
"CREATE": true
},
"group": {
"DELETE": true,
"READ": true,
"UPDATE": true,
"CREATE": true
},
"user": {
"DELETE": true,
"READ": true,
"UPDATE": true,
"CREATE": true
}
},
"email": "raghuram.k#cafyne.com",
"meta": {},
"isAdmin": "false",
"iat": 1487919175,
"exp": 1487926375
}
Now I need to send only the _org value, Which is highlighted, as input to another http request. Any suggestions?
I would recommend switching to JSR223 PostProcessor and Groovy language as:
Groovy has built-in Base64 encoding/decoding support
Groovy has built-in JSON support
Groovy is more Java-compliant
Groovy performs much better than Beanshell
So you can get your _org value as simple as:
def response = vars.get("data")
def decodedResponse = new String(response.decodeBase64())
def json = new groovy.json.JsonSlurper().parseText(decodedResponse)
log.info(json._org)
See Groovy Is the New Black article for more comprehensive information.

Laravel Cashier: Resume a single payment

after a successful payment I store the stripe id on a mysql table. With that id I would like to retrieve all the details stored in the stripe database.
So is it possible to resume a single payment by the stripe id?
Thanks
Here is the documentation you need to use: https://stripe.com/docs/api/php#retrieve_customer
Use the "customer retrieve" Stripe API call to retrieve details about the customer's purchase:
Stripe::setApiKey(Config::get('your_stripe_secret_key_here'));
$customer_object = Customer::retrieve(customers_stripe_id);
This will return the following JSON:
Stripe\Customer JSON: {
"id": "cus_7KJZQ8Z6jfSSMl",
"object": "customer",
"account_balance": 0,
"created": 1447172728,
"currency": "usd",
"default_source": "card_175evz2eZvKYlo2CKoS2WEDk",
"delinquent": false,
"description": "Bingo|www|0c1234567890",
"discount": null,
"email": null,
"livemode": false,
"metadata": {
},
"shipping": null,
"sources": {
"object": "list",
"data": [
{
"id": "card_175evz2eZvKYlo2CKoS2WEDk",
"object": "card",
"address_city": null,
"address_country": null,
"address_line1": null,
"address_line1_check": null,
"address_line2": null,
"address_state": null,
"address_zip": null,
"address_zip_check": null,
"brand": "Visa",
"country": "US",
"customer": "cus_7KJZQ8Z6jfSSMl",
"cvc_check": "pass",
"dynamic_last4": null,
"exp_month": 5,
"exp_year": 2016,
"funding": "credit",
"last4": "4242",
"metadata": {
},
"name": null,
"tokenization_method": null
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/sources"
},
"subscriptions": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/customers/cus_7KJZQ8Z6jfSSMl/subscriptions"
}
}
Here is Stripe's version of the API call:
\Stripe\Stripe::setApiKey("your_secret_key");
\Stripe\Customer::retrieve("the_customers_id");
Make sure to import the \Stripe classes by adding this at the top of your Model or Controller:
use Stripe\Customer;
use Stripe\Stripe;
if you want to use "Stripe" instead of \Stripe\Stripe and \Stripe\Customer prefixes)

Duplicate ID in PUT url when editing Restangular model in ui-router custom path

currently I'm setting up restangular to edit my model. Formerly it was ok when I'm not using custom url to show the form, like
http://example.com/admin/clients (I just load the form there).
But, then I use ui-router to setup the URL like this
http://example.com/admin/clients/{clientId}/edit
When I do model.put() or model.save(), the resulting PUT url is wrong. It become like this
PUT http://referral.dev/admin/clients/f2aa1490-5a8f-11e5-b936-b3a54e0c9925/f2aa1490-5a8f-11e5-b936-b3a54e0c9925
It should be like this:
PUT http://referral.dev/admin/clients/f2aa1490-5a8f-11e5-b936-b3a54e0c9925
What I do wrong?
For convenience, here is debug from restangular object:
{
"restangularCollection": false,
"$object": {
"id": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"referrer_id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Claudia.Kertzmann#hotmail.com",
"first_name": "Isabelle",
"last_name": "Herzog",
"mobile": "450.357.8579x621",
"stage": "member",
"stage_at": "2015-09-09 00:00:00",
"previous_stages": [
{
"stage": "lead",
"stage_at": "2015-08-30 00:00:00"
}
],
"total_investment": 190000,
"email_token": "caf34dddfe00f36b180d459236830934",
"confirmed": false,
"unsubscribed": false,
"transfered_at": null,
"previous_referrers": [],
"created_at": "2015-09-14 03:23:20",
"updated_at": "2015-09-14 03:23:20",
"referrer": {
"id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Eulalia.Pacocha#Dickens.biz",
"name": "Esperanza Aufderhar Sr.",
"mobile": "658.549.0277",
"role": "referrer",
"organization_id": "f0577b10-5a8f-11e5-984f-f120de15e3c1",
"last_login_at": "0000-00-00 00:00:00",
"suspended": 0
},
"route": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"reqParams": null,
"restangularized": true,
"fromServer": true,
"parentResource": {
"route": "admin/clients",
"parentResource": null
},
"restangularCollection": false
}
}
And, here is the restangular object if don't use custom URL (which working):
{
"id": "f2aa1490-5a8f-11e5-b936-b3a54e0c9925",
"referrer_id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Claudia.Kertzmann#hotmail.com",
"first_name": "Isabelle",
"last_name": "Herzog",
"mobile": "450.357.8579x621",
"stage": "member",
"stage_at": "2015-09-09 00:00:00",
"previous_stages": [
{
"stage": "lead",
"stage_at": "2015-08-30 00:00:00"
}
],
"total_investment": 190000,
"email_token": "caf34dddfe00f36b180d459236830934",
"confirmed": false,
"unsubscribed": false,
"transfered_at": null,
"previous_referrers": [],
"created_at": "2015-09-14 03:23:20",
"updated_at": "2015-09-14 03:23:20",
"referrer": {
"id": "f1529d80-5a8f-11e5-8ca1-21124a5fa590",
"email": "Eulalia.Pacocha#Dickens.biz",
"name": "Esperanza Aufderhar Sr.",
"mobile": "658.549.0277",
"role": "referrer",
"organization_id": "f0577b10-5a8f-11e5-984f-f120de15e3c1",
"last_login_at": "0000-00-00 00:00:00",
"suspended": 0
},
"route": "admin/clients",
"reqParams": null,
"restangularized": true,
"fromServer": true,
"parentResource": null,
"restangularCollection": false
}
I've tried manually set $object.route to "admin/clients" but the PUT url is still the same.
Thanks.. :)
I've solved it. Formerly I was using:
var models = Restangular.all('admin/clients');
Then use
models.one($stateParams.clientId).get()
to get the model.
The correct way, is use Restangular.one to load model, eg. like this:
vm.model = Restangular.one('admin/clients', $stateParams.clientId).get();

How to get filtered activity stream using Yammer API?

Yammer Activity Stream is available at:
https://www.yammer.com/api/v1/streams/activities.json?access_token=
This successfully results in all the recent activities like:
{
"items": [
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191477209921-45191477209921",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": null,
"category": "file-create",
"message": "[[user:1508783078]] uploaded [[uploaded_file:24511980]].",
"heading": "",
"created_at": "2014/10/02 07:07:42 +0000",
"objects": [],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24511980
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
{
"id": "/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746",
"unseen": true,
"icon": "/images/notifications/page_add.png",
"icon_name": "page",
"category": "file-download",
"message": "[[user:1508783078]] downloaded [[uploaded_file:24373320]] from the [[group:3455089]] group.",
"heading": "",
"created_at": "2014/10/02 07:07:00 +0000",
"objects": [
{
"id": 24373320,
"type": "uploaded_file"
}
],
"actions": [],
"subject": {
"type": "uploaded_file",
"id": 24373320
},
"meta": null,
"client_type": "unknown",
"client_url": "https://www.yammer.com",
"client_icon": "https://mug0.assets-yammer.com/mugshot/images/16x16/3rd_party.png",
"client_large_icon": "https://mug0.assets-yammer.com/mugshot/images/75x75/3rd_party.png",
"image": "https://mug0.assets-yammer.com/mugshot/images/48x48/no_photo.png",
"third_party": false
},
]}
QUESTION:
I am trying to get all the recent activities after a certain time-stamp or after a certain offset. Is there any query parameter for that?
this is
older_than="/users/www.yammer.com-341514-1508953644/rollups/45191475863746-45191475863746"
that would return all the activities older than the last activities you shew in your sample return value

Ruby JSON.parse returns an Array

I'm trying to parse a JSON string that I received from Twitter as a response via the RESTful API. I wanted to use the JSON gem, but I've run into an issue. Per the documentation, it appears that the JSON parser returns a Hash, which is what I want. However, when I actually perform the JSON.parse(twitter_result.body), it returns an Array. How can I get the JSON parser to return a Hash?
This is the parser I am using: http://www.ruby-doc.org/stdlib-1.9.3/libdoc/json/rdoc/JSON.html#method-i-parse
"Pretty" JSON output example:
[
{
"created_at": "Sun Dec 08 13:00:52 +0000 2013",
"id": 409668902189137920,
"id_str": "409668902189137920",
"text": "\"All the people departed, and David went home to bless his household.\" 1 Chron. 16:43. Big meeting. Blessed home. Both.",
"source": "HootSuite",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 27500565,
"id_str": "27500565",
"name": "John Piper",
"screen_name": "JohnPiper",
"location": "Minneapolis, MN",
"description": "Founder-Teacher, Desiring God, Chancellor, BCS. Spreading a passion for the supremacy of God in all things for the joy of all peoples through Jesus Christ.",
"url": "http://t.co/qt1rUlRfdl",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co/qt1rUlRfdl",
"expanded_url": "http://www.desiringgod.org",
"display_url": "desiringgod.org",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 564749,
"friends_count": 107,
[
{
"created_at": "Sun Dec 08 13:00:52 +0000 2013",
"id": 409668902189137920,
"id_str": "409668902189137920",
"text": "\"All the people departed, and David went home to bless his household.\" 1 Chron. 16:43. Big meeting. Blessed home. Both.",
"source": "HootSuite",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
"in_reply_to_user_id_str": null,
"in_reply_to_screen_name": null,
"user": {
"id": 27500565,
"id_str": "27500565",
"name": "John Piper",
"screen_name": "JohnPiper",
"location": "Minneapolis, MN",
"description": "Founder-Teacher, Desiring God, Chancellor, BCS. Spreading a passion for the supremacy of God in all things for the joy of all peoples through Jesus Christ.",
"url": "http://t.co/qt1rUlRfdl",
"entities": {
"url": {
"urls": [
{
"url": "http://t.co/qt1rUlRfdl",
"expanded_url": "http://www.desiringgod.org",
"display_url": "desiringgod.org",
"indices": [
0,
22
]
}
]
},
"description": {
"urls": [
]
}
},
"protected": false,
"followers_count": 564749,
"friends_count": 107,
"listed_count": 9225,
"created_at": "Sun Mar 29 20:48:44 +0000 2009",
"favourites_count": 20,
"utc_offset": -21600,
"time_zone": "Central Time (US & Canada)",
"geo_enabled": true,
"verified": true,
"statuses_count": 7906,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "570000",
"profile_background_image_url": "http://a0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_link_color": "5C0606",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "CCC2A3",
"profile_text_color": "000000",
"profile_use_background_image": true,
"default_profile": false,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 20,
"favorite_count": 31,
"entities": {
"hashtags": [
],
"symbols": [
],
"urls": [
],
"user_mentions": [
]
},
"favorited": false,
"retweeted": false,
"lang": "en"
}
] "listed_count": 9225,
"created_at": "Sun Mar 29 20:48:44 +0000 2009",
"favourites_count": 20,
"utc_offset": -21600,
"time_zone": "Central Time (US & Canada)",
"geo_enabled": true,
"verified": true,
"statuses_count": 7906,
"lang": "en",
"contributors_enabled": false,
"is_translator": false,
"profile_background_color": "570000",
"profile_background_image_url": "http://a0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_image_url_https": "https://si0.twimg.com/profile_background_images/38963234/jp_twitter_1920x1200_b_2.jpg",
"profile_background_tile": false,
"profile_image_url": "http://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_image_url_https": "https://pbs.twimg.com/profile_images/1563845055/2010fallJPmug_normal.jpeg",
"profile_link_color": "5C0606",
"profile_sidebar_border_color": "000000",
"profile_sidebar_fill_color": "CCC2A3",
"profile_text_color": "000000",
"profile_use_background_image": true,
"default_profile": false,
"default_profile_image": false,
"following": true,
"follow_request_sent": false,
"notifications": false
},
"geo": null,
"coordinates": null,
"place": null,
"contributors": null,
"retweet_count": 20,
"favorite_count": 31,
"entities": {
"hashtags": [
],
"symbols": [
],
"urls": [
],
"user_mentions": [
]
},
"favorited": false,
"retweeted": false,
"lang": "en"
}
]
JSON output returns an array with one element which is the Hash you're looking for.
Try this:
puts JSON.parse(twitter_result.body)[0]

Resources