Why I'm not geting token in res in braintree? - paypal-sandbox

I'm using braintree for payment and I have done this.
gateway.customer.create({
firstName: "Sachin",
lastName: "Shah",
company: "Qwerty",
email: "Qwerty#example.com",
phone: "114.555.1234",
fax: "614.555.1234",
website: "www.example.com",
}, function (err, result) {
if (err) {
res.send({code:0, status:'Error', message:err});
}else{
res.send({code:1, status:'Success', data: result});
}
});
I followed it's official doc and they show that when req is success I'll get token but I'm gtting result.customer.paymentMethods[]
Response
{
"code": 1,
"status": "Success",
"data": {
"customer": {
"id": "569549779",
"merchantId": "XXXXXXXXXXXXXXXXX",
"firstName": "Sachin",
"lastName": "Shah",
"company": "Qwerty",
"email": "Qwerty#example.com",
"phone": "114.555.1234",
"fax": "614.555.1234",
"website": "www.example.com",
"createdAt": "2019-10-10T05:13:42Z",
"updatedAt": "2019-10-10T05:13:42Z",
"customFields": "",
"globalId": "XXXXXXXXXXXXXXXXX",
"creditCards": [],
"addresses": [],
"paymentMethods": []
},
"success": true
}
}
Expected Output
I need to get paymentMethodToken for further API calls.

Full disclosure: I work at Braintree. If you have any further questions, feel free to contact support.
You're currently creating a customer without a payment method. You'll need to create the customer with a payment method to retrieve a paymentMethodToken.

Related

Firebase beforeCreate not adding custom claims

I am using Firebase Authentication with Identify Platform and am trying to add custom claims when a user is created. I am looking at this example from Google's website here: Setting custom and session claims:
exports.beforeCreate = functions.auth.user().beforeCreate((user, context) => {
if (context.credential &&
context.credential.providerId === 'saml.my-provider-id') {
return {
// Employee ID does not change so save in persistent claims (stored in
// Auth DB).
customClaims: {
eid: context.credential.claims.employeeid,
},
// Copy role and groups to token claims. These will not be persisted.
sessionClaims: {
role: context.credential.claims.role,
groups: context.credential.claims.groups,
}
}
}
});
The code is straight forward. I am trying to add custom claims for all new users but they are not getting set. I am not sure how else to to try. This is my actual code:
exports.beforeUserCreate = functions.auth.user().beforeCreate((user, context) => {
functions.logger.info('Attempting to set claims for new user', user);
functions.logger.info('Here is the context', context);
return {
customClaims: {
roles: ['user'],
},
sessionClaims: {
roles: ['user'],
},
};
});
I do see the logs in the Google console, so I know my function is being called. I also tested the claims without the array like roles: 'TestRole', but that didn't work either. The user object just does not have the custom claims.
If I manually set the claims they do show up as expected:
{
"roles": [
"admin",
"subscriber",
"superadmin"
],
"iss": "https://securetoken.google.com/...",
"aud": "xxx",
"auth_time": 1661813313,
"user_id": "xxxx",
"sub": "xxx",
"iat": 1661813313,
"exp": 1661816913,
"email": "xxx",
"email_verified": false,
"firebase": {
"identities": {
"email": [
"xx"
]
},
"sign_in_provider": "password"
}
}
This is what the user object looks like when I try to create the claims automatically:
{
"iss": "https://securetoken.google.com/...",
"aud": "xxx",
"auth_time": 1661813351,
"user_id": "xxx",
"sub": "xxx",
"iat": 1661813351,
"exp": 1661816951,
"email": "xxx",
"email_verified": false,
"firebase": {
"identities": {
"email": [
"xxx"
]
},
"sign_in_provider": "password"
}
}
Also, I tried setting both customClaims and sessionClaims independently. Neither show up on the user object, nor are the custom claims saved for the user.
One more update. I tried setting the display name in beforeCreate and that worked.
return {
customClaims: {
roles: 'pie',
},
displayName: 'pie',
};
// RESULT:
{
"name": "pie",
"iss": "https://securetoken.google.com/...",
"aud": "xxx",
"auth_time": 1661816987,
"user_id": "xxx",
"sub": "xxx",
"iat": 1661816987,
"exp": 1661820587,
"email": "xxx",
"email_verified": false,
"firebase": {
"identities": {
"email": [
"xxx"
]
},
"sign_in_provider": "password"
}
}
From Darwin in comments:
Hi #Gremash , there's an open github issue regarding that. See sessionClaims content not getting added to the decoded token. Also, there's a fix that has been recently merged regarding this issue.

Meteor user accounts issue - Duplicate account being created with OAuth service (accounts-google)

I am working with Meteor User accounts to create users. I have implemented two ways of creating users.
By using accounts-password to create (default one ).
OAuth Services (accounts-google and accounts-facebook)
A user account generated with accounts-password have the document shown below
{
"_id": "DQnDpEag2kPevSdJY",
"createdAt": "2015-12-10T22:34:17.610Z",
"services": {
"password": {
"bcrypt": "XXX"
},
"resume": {
"loginTokens": [
{
"when": "2015-12-10T22:34:17.615Z",
"hashedToken": "XXX"
}
]
}
},
-----
----
}
Where as a user account generated with accounts-google or account-facebook have the document shown below.
{
"_id": "Ap85ac4r6Xe3paeAh",
"createdAt": "2015-12-10T22:29:46.854Z",
"services": {
"facebook": {
"accessToken": "XXX",
"expiresAt": 1454970581716,
"id": "XXX",
"email": "myname#gmail.com",
"name": "Ada Lovelace",
"first_name": "Ada",
"last_name": "Lovelace",
"link": "https://www.facebook.com/app_scoped_user_id/XXX/",
"gender": "female",
"locale": "en_US",
"age_range": {
"min": 21
}
},
---
---
---
Now the real issue is, Although the email address used is same for both accounts-password and accounts-google (in my case email is myname#gmail.com), two different user accounts are being created.
I am looking for solution Something like below. (Note: Services has both "Password" and "Facebook" sections under single account)
{
"_id": "DQnDpEag2kPevSdJY",
"createdAt": "2015-12-10T22:34:17.610Z",
"services": {
"password": {
"bcrypt": "XXX"
},
"facebook": {
"accessToken": "XXX",
"expiresAt": 1454970581716,
"id": "XXX",
"email": "myname#gmail.com",
"name": "Ada Lovelace",
"first_name": "Ada",
"last_name": "Lovelace",
"link": "https://www.facebook.com/app_scoped_user_id/XXX/",
"gender": "female",
"locale": "en_US",
"age_range": {
"min": 21
}
},
},
-----
----
}
Is there a way where only one account is being generated in both cases, means if a user is already existed and the same is trying with OAuth service, first account should be used to accommodate the service ?
link-accounts package is the recommended way to allow users to add additional services to their account.
You can use Accounts.setPassword on the server in order to generate a proper bcrypt hash for the accounts:
Accounts.setPassword('Ap85ac4r6Xe3paeAh', 'the-new-password')
which will result in
{
"_id": "Ap85ac4r6Xe3paeAh",
"createdAt": "2015-12-10T22:29:46.854Z",
"services": {
"password": {
"bcrypt": "$2b$10$nzHCivxVqxbuFBBPWewPPu.r5x7OR5gJB8PIklU4OoU.WK0MT8jt2"
},
"facebook": {
"accessToken": "XXX",
"expiresAt": 1454970581716,
"id": "XXX",
"email": "myname#gmail.com",
"name": "Ada Lovelace",
"first_name": "Ada",
"last_name": "Lovelace",
"link": "https://www.facebook.com/app_scoped_user_id/XXX/",
"gender": "female",
"locale": "en_US",
"age_range": {
"min": 21
}
}
}
}
I have solved the above issue with a hack.
In imports/startup/server/accounts.js I have added the below validation logic which always validates the newly created account.
The idea is, this process checks if user is already existed in database. If the user exists, further checks if its created from accounts-password or accounts-google/facebook .
Based on the existing type modify the existing fields with new fields and throw an error with a fancy message (This actually prevents the new account to be created).
Accounts.validateNewUser(function (user) {
// first check what is the newly creating service
var service =
user.services.google || user.services.facebook || user.services.password;
if (!service) return true;
var existingUser = null;
// due to some issues both `Meteor.users.findOne(email)` as well `Account.findUserByEmail(email)` methods have been used to find the existing user status
if (user.services.password) {
var email = user.emails[0].address;
existingUser = Meteor.users.findOne({
$or: [
{ "registered_emails[0].address": email },
{ "services.google.email": email },
{ "services.facebook.email": email },
],
});
} else {
var email = service.email;
//console.log(" retrieved email ", email);
existingUser = Accounts.findUserByEmail(email);
}
//console.log(" existingUser : ", existingUser);
if (!existingUser) return true;
if (user.services.google) {
Meteor.users.update(
{ _id: existingUser._id },
{
$set: {
profile: user.profile,
"services.google": user.services.google,
},
}
);
} else if (user.services.facebook) {
Meteor.users.update(
{ _id: existingUser._id },
{
$set: {
profile: user.profile,
"services.facebook": user.services.facebook,
},
}
);
} else {
Meteor.users.update(
{ _id: existingUser._id },
{
$set: {
profile: user.profile,
"services.password": user.services.password,
"services.email": user.services.email,
emails: user.emails,
},
}
);
}
throw new Meteor.Error(
205,
"Merged with your existing Social Login accounts now. Try refresh the page and sign in again. That should work !!"
);
});

Linkedin API v2: Receive vanityname on signup linkedin

I'm doing the sign up integration with LinkedIn for a personal application and i have a big trouble.
We need the vanityName in order to make people visible via linkedin.
How we can redirect them to profiles without using vanityName? I tried with ID unsuccessfully.
I use this endpoint with r_liteprofile scope:
https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,vanityName,profilePicture(displayImage~:playableStreams))
and it returns me:
{
"firstName": {
"localized": {
"es_ES": "XXX"
},
"preferredLocale": {
"country": "ES",
"language": "es"
}
},
"lastName": {
"localized": {
"es_ES": "XXX"
},
"preferredLocale": {
"country": "ES",
"language": "es"
}
},
"profilePicture": {
"displayImage": "XXX",
"displayImage~": {
"elements": [...]
}
},
"id": "AX-Wv6r0Ku"
}
You can use the me endpoint of the Profile API in order to Retrieve Current Member's Profile. As example:
https://api.linkedin.com/v2/me?oauth2_access_token=<user_access_token>
With the result:
{
"firstName":{
"localized":{
"en_US":"Bob"
},
"preferredLocale":{
"country":"US",
"language":"en"
}
},
"localizedFirstName": "Bob",
"headline":{
"localized":{
"en_US":"API Enthusiast at LinkedIn"
},
"preferredLocale":{
"country":"US",
"language":"en"
}
},
"localizedHeadline": "API Enthusiast at LinkedIn",
"vanityName": "bsmith",
"id":"yrZCpj2Z12",
"lastName":{
"localized":{
"en_US":"Smith"
},
"preferredLocale":{
"country":"US",
"language":"en"
}
},
"localizedLastName": "Smith",
"profilePicture": {
"displayImage": "urn:li:digitalmediaAsset:C4D00AAAAbBCDEFGhiJ"
}
}
If you want to retrieve only the vanityName field you can use the Field Projections as follow:
https://api.linkedin.com/v2/me?projection=(vanityName)&oauth2_access_token
With the result:
{
"vanityName": "bsmith"
}
Hope this help

OneDrive API search based on a keyword gives only section information and doesnot give any information about page details

I want to know the page id or page url which has paternity in the content. When i use search functionality, i get the section details but i don't get any information about page.
Query:
https://graph.microsoft.com/v1.0/me/drive/root/search(q='paternity')
Result:
{
"#odata.context": "https://graph.microsoft.com/v1.0/$metadata#Collection(driveItem)",
"value": [
{
"#odata.type": "#microsoft.graph.driveItem",
"createdDateTime": "2018-07-11T11:06:28Z",
"id": "dfhsdfkhfklsdfsdkjf",
"lastModifiedDateTime": "2018-07-11T11:20:26Z",
"name": "Section1.one",
"webUrl": "https://microsoft-my.sharepoint.com/personal/abcd_contoso_com/_layouts/15/WopiFrame.aspx?sourcedoc=%7B7E1C4305-983D-4CE2-A15E-DBAF1B961423%7D&file=Section1.one&action=default&DefaultItemOpen=1",
"size": 390328,
"createdBy": {
"user": {
"email": "abcd#contoso.com",
"displayName": "abcd"
}
},
"lastModifiedBy": {
"user": {
"email": "abcd#contoso.com",
"displayName": "abcd"
}
},
"parentReference": {
"driveId": "b!QqRkFzhjsdgjkdhfkjdhXiDBfhDiNEmqz4NJGbg-Gcv-NrFDvVRJca8R9-3ylQ",
"driveType": "business",
"id": "01QsdjhdkjhdsdkjhHGT4FXINN2A"
},
"file": {
"mimeType": "application/msonenote"
},
"fileSystemInfo": {
"createdDateTime": "2018-07-11T11:06:28Z",
"lastModifiedDateTime": "2018-07-11T11:20:26Z"
},
"searchResult": {}
}
]
}
Please advise on how to get page level information
The OneNote API has search - you may try using that one:
https://blogs.msdn.microsoft.com/onenotedev/2014/11/17/introducing-the-onenote-search-api-beta-powered-by-bing/

Do the UCWA or UCMA APIs support Skype for Business Online?

We are trying to figure out whether the latest UCWA or UCMA supports Skype for Business Online. After a long search, I saw someone posted in March/April 2015 and said that UCMA/UCWA did not yet support it. But then, I could not find anything about this.
Is the latest version able to support it?
Where can I find any information about this?
UCWA is now available for Skype for Business Online. The steps to get your UCWA application registered and authenticated are quite different to using UCWA for Skype for Business Server, but once you're signed in, the actual API is almost identical. Right now, the Skype for Business Online version of UCWA has slightly fewer capabilities than the Skype for Business Server version - for example, messages can be sent but not received - though this should change soon.
UCMA is not available for Skype for Business Online for the reasons explained in this question and answer.
Skype for Business Online uses Azure AD for authentication, which you can authenticate against using username and password with the ADAL.net library.
http://www.cloudidentity.com/blog/2014/07/08/using-adal-net-to-authenticate-users-via-usernamepassword/
I've created a sample .NET console app that signs into Skype for Business Online using UCWA and username and password authentication. It works in many simple scenarios.
Before starting the following steps, user must register an application in Azure AD and give all the access to the necessary API and collect
Client ID
Client Secert
From PostMan extension: One can follow the following steps a meeting using UCWA on Skype For Business(SFB) online:
Step1 >Get the token for user
1) request in Only IE browser
https://login.microsoftonline.com/88****-da69-4e7d-a5dc-b3a*****1d/oauth2/authorize?
response_type=code
&client_id=6e****44-2**3-4**2-8**c-e*******e72
&client_secret=bdjmKq**************************nQMtbzA=
&resource=https://webdirin1.online.lync.com (This url should be used for user)
2) Post request token with code
https://login.windows.net/88****-da69-4e7d-a5dc-b3a*****1d/oauth2/token
grant_type=authorization_code
&client_id=6e****44-2**3-4**2-8**c-e*******e72
&code=AQABAAIAAABnfiG-mA6NTae7CdWW7Qfda84eiCww0aSunFfvkaLq3OJZBDzX6*****97HQl****dsK53_7iM8Bq_qXWuH6M8TqPu5Py51eSB2QuhQyYcZv_28I36FC7ODudIp9_8zsxUmOKJbZXvDiEk0YjDkfacW2homgolt4mZ-E05_D4j77Gp3b1K0f7yuZbHPFjkvloIvOhPWYT953uIrJvj6Tm8zmTPpcAJeusuilXJAJS3Pl19o7zBwFBJ4EtkK06HsA_uGAZnrD2-0vxWadcUWv-fzijVCtEE9yZGGj6a0SQwu6XKdhunS7waAsKFAjDhJ6fP431pkWoD5mDRtXvz6riYMTLYRNjTS6UWyX2oBNO0DhoNXHG95YAoGDgftBvaUpI9*****ZIFPDUTPcYSRiYcMKF21ILCy1I_scXGmL1QtE1MSQjsu6c1lGZhVqzMEWHX57wcRiEHCTAlao-3fJm-KvYQn1DqiX3tJDkx0cmAEwr6iCeM37QEBKD-PZ0CAUrIY9uwXenaxkunoD_XG5YDuE2in4BcJiDwEccaFh0BdmQXEqln-pd9QgAA&session_state=0b92ca54-cd08-4a28-9f20-216245e289f0
&redirectUri=http://localhost/TServ
&resource=https://webdirin1.online.lync.com
&client_secret=bdjmKq**************************nQMtbzA=
Step 2>Get Application URL:
Request:
URL:https://webdirin1.online.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user
Authorization: Bearer <Previous access code>
Response:
{
"_links": {
"self": {
"href": "https://webpoolmaain***.infra.lync.com/Autodiscover/AutodiscoverService.svc/root/oauth/user"
},
"applications": {
"href": "https://webpoolmaain***.infra.lync.com/ucwa/oauth/v1/applications",
"revision": "2"
},
"xframe": {
"href": "https://webpoolmaain***.infra.lync.com/Autodiscover/XFrame/XFrame.html"
}
}
}
Step 3>Get the token for application
1) request in Only IE browser
https://login.microsoftonline.com/88****-da69-4e7d-a5dc-b3a*****1d/oauth2/authorize?
response_type=code
&client_id=6e****44-2**3-4**2-8**c-e*******e72
&client_secret=bdjmKq**************************nQMtbzA=
&resource=https://webpoolmaain***.infra.lync.com (this resource url is the application url got it from Step 2)
response http://localhost/TServ/?code=AQABAAIAAABnfiG-mA6NTae7CdWW7QfdAe8KrUbxREZpqyau_gGtw4QSTzq5MHmALQQa_n_AvVeK0iMRaESOZMkuGJ1a3bvWEYpMTHOyGfT2r9T8WbeSW7vJR-6Upnv6qI-nrT3kM8jXRni2V9S_y6xibRwDAE160XYeu9aJkbAE9Wq4HquYSUkC1bcNZSqmpubv2MiixMcjwL00YP8c53bRu44yWXr1FWr5Rgnc8VbnoZyxJF7CgfbTOrfDusXeLHj7OGGevyh8ZsKXYxJh9CrZ0u1NyGJgeGPFxDJbUxfkli49MW1x-Lbf2qhdPCN10b_nq3s5YD92Pk_S6mAtfmrVpTalEeHfSBTMqxAVtf3nc6f4QbQvTZx988HoQ_gHLLt_4J9trYTPA-OEmLUvmgu9DQHTpCAg_ACEPvi7bmMkBxtLo7tQp6fSXBUZ5p6buBqNYzPFs8b_BGodkRKU_hDqWbFc-nmHfx7qYmW1gVNB1G9LvfHGVqiNUg3KJBjcmonwKcu-JoYNIucd9xop15OtsBuusLEY8sEVstq9bIYyIw8__xH56MKh7wJTV_cm52qSq4E_d4ogAA&session_state=abe98e32-ffc7-4ed5-94d1-e894ed53d52d
2) post request token with code
https://login.windows.net/88****-da69-4e7d-a5dc-b3a*****1d/oauth2/token
grant_type=authorization_code
&client_id=6e****44-2**3-4**2-8**c-e*******e72 &code=AQABAAIAAABnfiG-mA6**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************37QEBKD-PZ0CAUrIY9uwXenaxkunoD_XG5YDuE2in4BcJiDwEccaFh0BdmQXEqln-pd9QgAA&session_state=0b92ca54-cd08-4a28-9f20-216245e289f0
&redirectUri=http://localhost/TServ
&resource=https://webpoolmaain***.infra.lync.com
&client_secret=bdjmKq**************************nQMtbzA=
response
{
"token_type": "Bearer",
"scope": "Contacts.ReadWrite Conversations.Initiate Conversations.Receive Meetings.ReadWrite User.ReadWrite",
"expires_in": "3599",
"ext_expires_in": "0",
"expires_on": "1493981291",
"not_before": "1493977391",
"resource": "https://webpoolmaain***.infra.lync.com",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6InowMzl6ZHNGdWl6cEJmQlZLMVRuMjVRSFlPMCIsImtpZCI6InowMzl6ZHNGdWl6cEJmQlZLMVRuMjVRSFlPMCJ9.eyJhdWQiOiJodHRwczovL3dlYnBvb2xtYWFpbjEwMi5pbmZyYS5seW5jLmNvbSIsImlzcyI6Imh0dHBzOi8vc3RzLndpbmRvd3MubmV0Lzg4MzU2ZGFjLWRhNjktNGU3ZC1hNWRjLWIzYWM1MzM0MWUxZC8iLCJpYXQiOjE0OTM5NzczOTEsIm5iZiI6MTQ5Mzk3NzM5MSwiZXhwIjoxNDkzOTgxMjkxLCJhY3IiOiIxIiwiYWlvIjoiWTJaZ1lEQXFTWGsrNGVEV3RiRmYyR01ZQmU4ZEZJN1A3UkpQWlRxVjdmRmNPZVRCdFJZQSIsImFtciI6WyJwd2QiXSwiYXBwaWQiOiI2ZTcxZGI0NC0yYjgzLTQ1YTItODcxYy1lY****************************************************************************************************************************************************************************************************************************************************************************************************************************************5ncy5SZWFkV3JpdGUgVXNlci5SZWFkV3JpdGUiLCJzdWIiOiJyZEF3Ql9XTjNQZlRaTEJaMmNfSmlEQ0QwVVFCNWZ0R0Y0Sk5JR25qZjRzIiwidGlkIjoiODgzNTZkYWMtZGE2OS00ZTdkLWE1ZGMtYjNhYzUzMzQxZTFkIiwidW5pcXVlX25hbWUiOiJnb3BhbHJlZGR5QHRlbHBzZ2Nsb3VkLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImdvcGFscmVkZHlAdGVscHNnY2xvdWQub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIn0.BpPYsoUFp4zJQo9Iwllq8bOskKxHom2m9Fw4PXgwZraAfF-LopT54AyNLzfVhjdODbLETl4FnJn140M0pasUI5rMEXYFN2byzusNW3OHojlWbJ5-WpHj8NlQPE02oCwZ81MDqhV1eKjs34rp42F_tQZFXevBJYSMZRATtz4chtQnkzLhJ_c5p4MNmAcA7sdho9kaPUF45tj8bWF9n7ktrD8w2-r0DddKyUW5YXa_pOJzQp4GucoCKBOkIYS85OaAuFe4_kiQOG_dfm1s_HPat4BMyZxMFNuocD0ai-6t7ug7KZ-CK63aqLE9mK9sQSKx9uDo5TOO0-5-FDIIP9eNLA",
"refresh_token": "AQABAAAAAABnfiG-mA6NTae7CdWW7Qfd2CWLGkoBoN9_yp-MKWaBRNCnAjH_YPC3YvbLUuGyKI4dzd4Y3W7y7-q7529kXaVLYIKDOISVtEKX-oHbNGjB4i2HdBXJpdWoiQsZiA2L7ZszaNevz06qUl5lqZjgzx3Lp5imPOyd0Ib_6****************************************************************************************************************************************************************************************************************************************************************************************************************************************Dpj4JIEjcWW8dDm-iplSLM4XpZJWvQ0hJDijkCOKxlg6Pab88I4YBwcrn1D5e1cS2tX3kVpGMBCN5YfRFHrET98293hd9Y88EmI1AFak3xoMOGPLePwH2C_gp2G-IiLLicNehvBdIAA",
"id_token": "eyJ0eXAiOiJ****************************************************************************************************************************************************************************************************************************************************************************************************************************************eXRTQ0pJRlNNcWxIRWs3Q3RSODBwTW5XMk1rIiwidGlkIjoiODgzNTZkYWMtZGE2OS00ZTdkLWE1ZGMtYjNhYzUzMzQxZTFkIiwidW5pcXVlX25hbWUiOiJnb3BhbHJlZGR5QHRlbHBzZ2Nsb3VkLm9ubWljcm9zb2Z0LmNvbSIsInVwbiI6ImdvcGFscmVkZHlAdGVscHNnY2xvdWQub25taWNyb3NvZnQuY29tIiwidmVyIjoiMS4wIn0."
}
Step 4>Get the application resource urls:
Request Type: Post
URL :https://webpoolmaain***.infra.lync.com/ucwa/oauth/v1/applications
Headers:
Authorization: Bearer <access code from Step 3.2>
Accept: application/json
Content-Type: application/json
Body:
{
"UserAgent":"UCWASamples",
"EndpointId":"88356dac-da69-4e7d-a5dc-b3ac53341e1d",
"Culture":"en-US"
}
Response:
{
"culture": "en-US",
"userAgent": "UCWASamples",
"type": "Browser",
"endpointId": "88356dac-da69-4e7d-a5dc-b3ac53341e1d",
"instanceId": "default",
"id": "10666478063",
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063"
},
"policies": {
"href": "/ucwa/oauth/v1/applications/10666478063/policies"
},
"batch": {
"href": "/ucwa/oauth/v1/applications/10666478063/batch"
},
"events": {
"href": "/ucwa/oauth/v1/applications/10666478063/events?ack=1&key=c2lwOmdvcGFscmVkZHlAdGVscHNnY2xvdWQub25taWNyb3NvZnQuY29t-10666478063-ZGVmYXVsdA%3D%3D"
}
},
"_embedded": {
"me": {
"uri": "sip:g*******y#t*******d.onmicrosoft.com",
"name": "G**********y",
"emailAddresses": [
"g*******y#t*******d.onmicrosoft.com"
],
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063/me"
},
"makeMeAvailable": {
"href": "/ucwa/oauth/v1/applications/10666478063/me/makeMeAvailable",
"revision": "2"
},
"photo": {
"href": "/ucwa/oauth/v1/applications/10666478063/photos/g*******y#t*******d.onmicrosoft.com"
}
},
"rel": "me"
},
"people": {
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063/people"
},
"presenceSubscriptions": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/presenceSubscriptions"
},
"subscribedContacts": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/subscribedContacts"
},
"presenceSubscriptionMemberships": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/presenceSubscriptionMemberships"
},
"myGroups": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/groups",
"revision": "2"
},
"myGroupMemberships": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/groupMemberships",
"revision": "2"
},
"myContacts": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/contacts"
},
"myPrivacyRelationships": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/privacyRelationships"
},
"myContactsAndGroupsSubscription": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/contactsAndGroupsSubscription"
},
"search": {
"href": "/ucwa/oauth/v1/applications/10666478063/people/search",
"revision": "2"
}
},
"rel": "people"
},
"onlineMeetings": {
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings"
},
"myOnlineMeetings": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/myOnlineMeetings"
},
"onlineMeetingDefaultValues": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/defaultValues"
},
"onlineMeetingEligibleValues": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/eligibleValues"
},
"onlineMeetingInvitationCustomization": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/customInvitation"
},
"onlineMeetingPolicies": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/policies"
},
"phoneDialInInformation": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/phoneDialInInformation"
}
},
"rel": "onlineMeetings"
},
"communication": {
"videoBasedScreenSharing": "Enabled",
"6845cfcf-c21f-4187-8d43-5***e57811a5": "please pass this in a PUT request",
"supportedModalities": [],
"supportedMessageFormats": [
"Plain"
],
"audioPreference": "PhoneAudio",
"publishEndpointLocation": true,
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication"
},
"mediaRelayAccessToken": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/mediaRelayAccessToken"
},
"mediaPolicies": {
"href": "/ucwa/oauth/v1/applications/10666478063/mediaPolicies"
},
"conversations": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/conversations?filter=active"
},
"startMessaging": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/messagingInvitations",
"revision": "2"
},
"startAudioVideo": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/audioVideoInvitations",
"revision": "2"
},
"startOnlineMeeting": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/onlineMeetingInvitations?onlineMeetingUri=adhoc"
},
"joinOnlineMeeting": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/onlineMeetingInvitations"
},
"missedItems": {
"href": "/ucwa/oauth/v1/applications/10666478063/communication/missedItems"
}
},
"rel": "communication",
"etag": "11133050"
}
},
"rel": "application",
"etag": "3184910031",
"expires": "/Date(1494266184733)/"
}
Step 5>Create Online Meeting:
Request Type: Post
URL :https://webpoolmaain***.infra.lync.com/ucwa/oauth/v1/applications/10666478063/onlineMeetings/myOnlineMeetings
Headers:
Authorization: Bearer <access code from Step 3.2>
Content-Type: application/json
Body:
{
"accessLevel" : "Everyone",
"attendanceAnnouncementsStatus":"Disabled",
"description":"hey guys let's do a musical!",
"subject":"Party Time",
"attendees": ["sip:vetrivels#t*******d.onmicrosoft.com","sip:g*******y#t*******d.co.in"],
"leaders": []
}
Response:
{
"accessLevel": "Everyone",
"entryExitAnnouncement": "Disabled",
"attendees": [
"sip:vetrivels#t*******d.onmicrosoft.com",
"sip:g*******y#t*******d.co.in"
],
"automaticLeaderAssignment": "Disabled",
"description": "hey guys let's do a musical!",
"leaders": [],
"onlineMeetingId": "JEHFP54F",
"onlineMeetingUri": "sip:g*******y#t*******d.onmicrosoft.com;gruu;opaque=app:conf:focus:id:JEHFP54F",
"legacyOnlineMeetingUri": "conf:sip:g*******y#t*******d.onmicrosoft.com;gruu;opaque=app:conf:focus:id:JEHFP54F?conversation-id=JEHFP54F",
"onlineMeetingRel": "myOnlineMeetings",
"organizerUri": "sip:g*******y#t*******d.onmicrosoft.com",
"phoneUserAdmission": "Disabled",
"lobbyBypassForPhoneUsers": "Disabled",
"subject": "Party Time",
"joinUrl": "https://meet.lync.com/t*******d/g*******y/JEHFP54F",
"6845cfcf-c21f-4187-8d43-5***e57811a5": "please pass this in a PUT request",
"_links": {
"self": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/myOnlineMeetings/JEHFP54F"
},
"onlineMeetingExtensions": {
"href": "/ucwa/oauth/v1/applications/10666478063/onlineMeetings/myOnlineMeetings/JEHFP54F/extensions"
}
},
"rel": "myOnlineMeeting",
"etag": "3135154093"
}
You have the following scope:
Contacts.ReadWrite
Conversations.Initiate
Conversations.Receive
Meetings.ReadWrite (Step 5 explains about creation of meeting)
User.ReadWrite
Refer: https://msdn.microsoft.com/en-us/skype/ucwa/skypeforbusinessonlinescopepermissions?f=255&MSPPError=-2147217396

Resources