YouTube V3 LiveBroadcasts: list issue with service account credentials - youtube-data-api

I was trying to make list api call to get the list of upcoming live streams. But when I was using service account credentials the API is always responding with below status.
{
"code" : 403,
"errors" : [ {
"domain" : "youtube.liveBroadcast",
"message" : "The user is not enabled for live streaming.",
"reason" : "liveStreamingNotEnabled",
"extendedHelp" : "https://www.youtube.com/features"
} ],
"message" : "The user is not enabled for live streaming."
}
Please let me know if I have to assign any specific role in IAM for this particular service account to allow this API to work.

Related

paypal refund order API return Authorization failed due to insufficient permissions

Currently i am redirecting order amount to merchant account that is working fine
but now when i perform refund operation getting persmission error
steps i followed :
gettting access token of merchant from his/her refresh token(stored in database) (using https://api-m.sandbox.paypal.com/v1/identity/openidconnect/tokenservice API)
now using above token(from step 1) for refund process in below API
https://api.sandbox.paypal.com/v2/payments/captures/{captureId}/refund where
captureId : got from order details
response of refund api :
{
"name": "NOT_AUTHORIZED",
"message": "Authorization failed due to insufficient permissions.",
"debug_id": "60091a8e09195",
"details": [
{
"issue": "PERMISSION_DENIED",
"field": "capture_id",
"value": "90Y75959CH863854A",
"description": "You do not have permission to access or perform operations on this resource.",
"location": "path"
}
],
"links": [
{
"href": "https://developer.paypal.com/docs/api/payments/v2/#error-PERMISSION_DENIED",
"rel": "information_link"}
]}
can someone help me to find what mistake am i doing ? and how can i resolve this issue ?
To determine which scopes you should try asking for during authorization, do a normal access_token request using your own credentials and look at the scopes variable returned.
https://uri.paypal.com/services/payments/refund seems relevant.

Gmail API using service account is getting delegation denied error message

I am developing a web-based application using Google API. I am using server-to-server which is obviously with a service account. I am almost done.
I can now insert new users through Google api. I can even create and/or give newly created users access to a Team Drive through Google API. Meaning, I have a service-account that can impersonate all domain users.
The Problem:
But why am I getting errors when trying to impersonate a user through Gmail API? I need to add Gmail Labels and Filters to newly created users but I am getting an error message stating "Deligation denied". Am I missing something?
Obviously I have a working service-account settings already with proper scopes in G Suite. I guess userID "me" is not an option since my application needs to impersonate a newly created G Suite user. Please correct me if I am wrong.
$service = new \Google_Service_Gmail($this->client($scopes));
$serviceLabel = new \Google_Service_Gmail_Label();
$serviceLabel->setLabelListVisibility('labelShow');
$serviceLabel->setMessageListVisibility('show');
$serviceLabel->setName($label_name);
try {
$resp = $service->users_labels->create($email, $serviceLabel);
} catch (Google_Service_Exception $e) {
return false;
}
Here is the error I am getting
{#398 ▼
+"statusCode": 403
+"errors": array:1 [▼
0 => array:3 [▼
"domain" => "global"
"reason" => "forbidden"
"message" => "Delegation denied for service-account-user#domain.com"
]
]
+"message": """
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Delegation denied for service-account-user#domain.com"
}
],
"code": 403,
"message": "Delegation denied for service-account-user#domain.com"
}
}
"""
}
A Gmail Label is expected to be added automatically for each user being created through the application.

Where to find RingCentral business-address email address?

The following business-address endpoint
URL: /restapi/v1.0/account/{accountId}/business-address
Ref: https://developer.ringcentral.com/api-docs/latest/index.html#!#RefGetAccountBusinessAddress
returns an email address property but it's coming back empty for me. There's no email address field on the Company Info page in the Online Account Portal UI at https://service.ringcentral.com:
Admin Portal > Phone System > Company Info > Company Address
The API Reference shows the following example response:
{
"uri" : "https.../restapi/v1.0/account/1215058004/business-address",
"businessAddress" : {
"street" : "13 Elm Street",
"city" : "Foster City",
"state" : "CA",
"zip" : "94404",
"country" : "United States"
},
"company" : "MyCompany Inc.",
"email" : "firstname.lastname#mycompany.com"
}
Can you tell me what config/UI element maps to the email address returned by the business-address endpoint?
The account/business-address API endpoint email property corresponds to the following UI field in the Online Account Portal - https://service.ringcentral.com :
Admin Portal > Phone System > Company Info > Directory Assistance > Email
The fields on that page will change the businessAddress, company, and email fields in the account/business-address API endpoint.
Note: Directory Assistance is not available in the Sandbox Account and can only be viewed/updated in Production.
Here is a screenshot from this knowledge base article:
https://success.ringcentral.com/knowledge/TOCArticleRendererPkb.apexp?id=kA280000000GscW

Spring reactive mongodb get subdocument

My application has users and servers, every user can have multiple servers. I would like to get a server by giving the user Id and the server name.
Example database:
{
"_id" : ObjectId("5a168093abfc7d0da1eaf039"),
"email" : "test#test.com",
"name" : "asdf",
"password" : "$2a$10$sC2WjxBdmsmN/x4GI7rgS.HBr4C.W8oxFJ7p/WMC24YcoARX8pNba",
"is_admin" : false,
"servers" : [
{
"_id" : BinData(3,"5xEk0HAIc7P+JevFrKP5lQ=="),
"name" : "asdf",
"host" : "asdf",
"ssl" : true
}
],
"_class" : "com.stack.database.main.model.User"
}
The user id is unique and the server name is unique per user. I would like to get the Server model(The servers list, not an actual #Document but a sub document) by giving the user id(5a168093abfc7d0da1eaf039) and the server name(asdf). I would like to use the repositories for this, the ReactiveCrudRepository repository.
I know I can get a user with a certain certain server name by using this in the UserRepository:
Mono<User> findByServers_Name(String name);
But I want to get the server model based on the user id and server name. I was thinking about something like this:
Mono<Server> findByIdAndServers_Name(ObjectId id, String name);
Note that this also has to be in the user model because the Server has no repository because it is a sub document.
How can I can a server model based on user id and server name with reactive crud repositories?

How to create a store and get store id in mail chimp for drupal commerce?

I need store id(store_id) to pass the value in this API.
/ecommerce/stores/{store_id}/carts
You need to first add a store to MailChimp using below API. Whatever id you pass in this request will be your store id for the subsequent requests.
https://usX.api.mailchimp.com/3.0/ecommerce/stores:
{
"id" : "store_001",
"list_id" : "205d96e6b4",
"name" : "Freddie's Jokes",
"domain" : "www.freddiesjokes.com",
"email_address" : "merchandise#freddiesjokes.com",
"currency_code" : "USD"
}
You can further check the Api at:
https://developer.mailchimp.com/documentation/mailchimp/reference/ecommerce/stores/

Resources