Adding Webhook to SharePoint List - postman

I'm using Postman to add a Webhook to a SharePoint List and am having an permission issue:
POST https://[Company].sharepoint.com/sites/Test/_api/web/lists('80105E8F-2CEA-4D49-8238-2A1829B46494')/subscriptions
Body:
{
"resource": "https://[Company].sharepoint.com/sites/Test/_api/web/lists('80105E8F-2CEA-4D49-8238-2A1829B46494')",
"notificationUrl": "https://MyFunctions.azurewebsites.net/api/HttpTriggerCSharp1?code=[ClientCode]",
"expirationDateTime": "2017-09-27T16:17:57+00:00"
}
Response:
{
"error": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": {
"lang": "en-US",
"value": "Access denied. You do not have permission to perform this action or access this resource."
}
}
}
I'm the SharePoint Site Collection Administrator and I can successfully list the current webhooks (there are none).
I'm listing the current webhooks with the following command:
GET https://[Company].sharepoint.com/sites/Test/_api/web/lists('80105E8F-2CEA-4D49-8238-2A1829B46494')/subscriptions
Response:
{
"d": {
"results": []
}
}

Related

Required permissions to read Google Workspace group members

I'm trying to read members of a google group using the following api:
https://developers.google.com/admin-sdk/directory/reference/rest/v1/members/list
but in response I get
{
"error": {
"code": 403,
"message": "Not Authorized to access this resource/api",
"errors": [
{
"message": "Not Authorized to access this resource/api",
"domain": "global",
"reason": "forbidden"
}
]
}
}
I'm a member of the group, but it seems that I need something more to be able to read the other member. Anyone know what are the required permissions to do that?

GCP API key is not valid in postman

I tried to create new dialogflow intent through postman. It is working in API Explorer but I can't able to connect dialogflow with postman. For doing this I have created some credentials,
New API key in GCP project
Oauth credentials in GCP project
Bearer token from google cloud SDK shell
Here I have used same API in postman but can't able to connect. How can I troubleshoot this?
{
"error": {
"code": 400,
"message": "API key not valid. Please pass a valid API key.",
"status": "INVALID_ARGUMENT",
"details": [
{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "API_KEY_INVALID",
"domain": "googleapis.com",
"metadata": {
"service": "dialogflow.googleapis.com"
}
}
]
}
}

401: Access denied. You are not authorized to read activity records

I am trying to test https://admin.googleapis.com/admin/reports/v1/activity/users/{userKey or all}/applications/{applicationName} in the browser using the API explorer utility but I am getting below error.
{
"error": {
"code": 401,
"message": "Access denied. You are not authorized to read activity records.",
"errors": [
{
"message": "Access denied. You are not authorized to read activity records.",
"domain": "global",
"reason": "authError",
"location": "Authorization",
"locationType": "header"
}
]
}
}
I have enabled all the necessary API scopes for the OAuth client. below is the screenshot of the scopes that I have enabled for my client.
The user which I was using along with the service account didn't have proper permission to access some of these APIs. I switched to a subject user with all necessary permissions and it started working fine for me.

How do I find which facebook messenger apps are linked with a facebook page through the facebook graph api?

I have been trying this out in the graph api explorer. Here are the steps I have been following:
Get a user access token with the permissions publish_actions, ads_management, manage_pages, publish_pages, pages_messaging, pages_messaging_phone_number, pages_messaging_subscriptions, pages_show_list, and user_events.
I GET the me/accounts endpoint and get this object:
{
"data": [
{
"access_token": "thisIsWhereTheAccessTokenGoes",
"category": "Shopping & Retail",
"category_list": [
{
"id": "200600219953504",
"name": "Shopping & Retail"
}
],
"name": "Some Page",
"id": "123456789",
"perms": [
"ADMINISTER",
"EDIT_PROFILE",
"CREATE_CONTENT",
"MODERATE_CONTENT",
"CREATE_ADS",
"BASIC_ADMIN"
]
}
],
"paging": {
"cursors": {
"before": "MTk1NDA4MDM2NDYyMDY5MAZDZD",
"after": "MTk1NDA4MDM2NDYyMDY5MAZDZD"
}
}
}
I copy the access token and page id from the above page object and paste it into the graph api explorer in the appropriate places.
I GET the endpoint {page-id}/subscribed_apps
I get this empty array:
{
"data": [
]
}
However if I go to my facebook app dashboard and go to the messenger settings and generate a page access token for the same page that I was getting in the graph api explorer, and then I paste that token into the explorer and get the {page-id}/subscribed_apps endpoint I actually get the app info that I was looking for. Something like this:
{
"data": [
{
"link": "https://www.facebook.com/games/?app_id=555555555555",
"name": "Test Messenger Bot",
"id": "555555555555"
}
]
}
I thought this could be because my app was in testing mode, but I tried to create a bot on chatfuel and linked it to the same facebook page and could not see that app listed under subscribed_apps either. I am thinking there is maybe some kind of permissions issue? I appreciate any help on this.

Handling error from server in ember

When i try to handling the response from server, I cant able to read the error status and detail (i.e., those fields are empty)
Below i show my response what i am getting,
{
"message": "Ember Data Request POST http://192.168.1.21:8888/api/test returned a 0?Payload (Empty Content-Type)?",
"name": "Error",
"errors":
[
{
"detail": "",
"status": "0",
"title": "The backend responded with an error",
}
],
"description":undefined,
"fileName":undefined
}
Why this fields are empty? what should i do to overcome this?