Gmail Postmaster tool API - google-api

I need to use Gmail Postmaster Tools API, but in google documentation I don't find it that useful. I am facing issue in finding out which API key to use and what credentials to create, like Service Account or OAuth 2. I want to test it locally. Here is the curl command I am using:
curl 'https://gmailpostmastertools.googleapis.com/v1beta1/domains/www.example.com/trafficStats/20200705?access_token=[ACCESS_TOKEN]' --header 'Accept: application/json' --compressed
Response:
{
"error": {
"code": 403,
"message": "The caller does not have permission",
"status": "PERMISSION_DENIED"
}
}

I can't try this but, if you're using oauth2l:
CREDENTIALS=[[Path to your service account]]
ENDPOINT="https://gmailpostmastertools.googleapis.com/v1beta1"
DOMAIN="www.example.com"
STATS="20200705"
URL="${ENDPOINT}/domains/${DOMAIN}/trafficStats/${STATS}"
oauth2l curl \
--scope=postmaster.readonly \
--credentials=${CREDENTIALS} \
--url=${URL}

Well it turns out that my domain was not verified with my google account. When I added DNS record than it started working.

Related

Kibana API Action and connector APIs returning 404

I'm trying to use the actions and connector endpoints of the kibana api and its giving me 404, but things to do with listing spaces work fine
https://www.elastic.co/guide/en/kibana/7.x/actions-and-connectors-api.html
curl --location --request GET 'https://kibana.<acme>.com/api/actions/connector_types' \
--header 'Authorization: Basic <redacted>'
{
"statusCode": 404,
"error": "Not Found",
"message": "Not Found" }

Error trying invoke business network. require is not defined

I followed this tutorial on macOS and upgraded to v0.0.2 using these model files. The POST SetupDemo API (curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{}' 'http://127.0.0.1:3000/api/SetupDemo') returns
{
"error": {
"statusCode": 500,
"name": "Error",
"message": "Error trying invoke business network. Error: No valid responses from any peers.\nResponse from attempted peer comms was an error: Error: transaction returned with failure: ReferenceError: require is not defined",
"stack": "Error: Error trying invoke business network. Error: No valid responses from any peers.\nResponse from attempted peer comms was an error: Error: transaction returned with failure: ReferenceError: require is not defined\n at HLFConnection.invokeChainCode (/Users/jps/.nvm/versions/node/v8.12.0/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:994:30)\n at <anonymous>"
}
}
The SetupDemo API did work on IBM Cloud BC before without this error.
$ node -v
v8.12.0

Authorize.net Webhooks - need detailed error message

We are trying to get up to speed using Authorize.net Webhooks to connect to our Salesforce external site. Our Salesforce endpoint seems to be working OK, because I can call it using curl from the command line and pass a JSON structure that gets successfully saved to our database. This much works fine.
However when I enter the URL of our Webhook into the "Endpoint URL:" field in Authorize.net and click the "Test Webhook" button, I get the error message:
"Error: Error occured in connecting to the endpoint: (prints my endpoint URL)
I am sure that I am calling the correct URL because I have copied and pasted it from the command line into the Endpoint URL field. But I need to know why I'm getting this error. Is there a debug log for Webhooks? Or how can I get a more detailed error message from Authorize.net?
Just be clear - this is testing a webhook call from Authorize.net -> Salesforce.
Edit: the CURL call that works from the command line is:
curl -X POST -H "Content-Type: application/json" -d '{"test":"this"}' \
https://my.server.com/mysite/services/apexrest/PYMT_AuthnetHook
Thanks and Best Regards!

TeamCity REST API Error: Error has occurred during request processing (Not Acceptable)

I tried to receive in .NET information about TeamCity build. All works fine, except one: I tried to get build name, using request to REST API.
Here is my request:
https://myteamcity/httpAuth/app/rest/buildTypes/id:<build_id>/name
And here is my error: Error has occurred during request processing (Not Acceptable).
Error: javax.ws.rs.WebApplicationException
Not supported request. Please check URL, HTTP method and transfered data are correct.
In browser I received correct plain text information. What's wrong with REST API? All another requests work well.
Accept header might cause the problem, try changing it to Accept: text/plain or removing it.
For example, when I request
curl -H "Accept: application/json" http://teamcity/httpAuth/app/rest/buildTypes/id:buildId/name --user user:pass
I'm getting the same error, but the name is returned after changing value of the header to text/plain
curl -H "Accept: text/plain" http://teamcity/httpAuth/app/rest/buildTypes/id:buildId/name --user user:pass
or after removing the header from the request
curl http://teamcity/httpAuth/app/rest/buildTypes/id:buildId/name --user user:pass

Cant authenticate Pep Proxy user generated in Horizon when starting Pep proxy

I created pep proxy user in Horizon.
Username:
pep_proxy_4ac90a28a7e0465caf0a9f32998ab47b
Password:
##################
And than i changed config.js of PEP proxy:
config.username = 'pep-proxy-aadd736bf4ea4739bd3bfe2cac4178c0';
config.password = '##################';
And when i start pep proxy i get this error:
ERROR: Server - Error in keystone communication {"error": {"message":
"The request you have made requires authentication.",
"code": 401, "title": "Unauthorized"}}
Can you help me with this.What might be the problem?
Thanks!
It seems that even though this user is created via Horizon it isn't granted any assignment in default domain.
I just ran
curl -v -s -X PUT -H "X-Auth-Token: ............................"
-H "Content-type: application/json"
http://192.168.4.180:5000/v3/domains/default/users/pep-proxy-aadd736bf4ea4739bd3bfe2cac4178c0/roles/4475dadfface4582ba8c7ab0c6f48d1c
where '4475dadfface4582ba8c7ab0c6f48d1c' is id of admin role.

Resources