What is the user-agent (bot) is used for LinkedIn share - linkedin

I'm trying to share article on LinkedIn and the api endpoint is https://www.linkedin.com/sharing/share-offsite/?url={url} used. Even though I have all og tags like og:title, og:url: og:image, og:discription etc., still it's showing the following console error
Error while processing route: inshare.index Ember Data Request GET /voyager/api/contentcreation/urlPreview [inshare-common/routes/index] Error: Ember Data Request GET /voyager/api/contentcreation/urlPreview [inshare-common/routes/index]

Related

sentry captureException doesnt show the entire error

I capture errors in a catch block using captureException(error); in my NextJS app.
However in Sentry it doesnt show the entire error message as I would see in the developer console. For example it only says: AxiosError: Network Error (see image below).
How can I make sure I get the entire error object?
For example, in the developer console I see this:
Access to XMLHttpRequest at 'https://www.hello.com/' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.but this is not in sentry
What you are looking at on the screenshot is called a "breadcrumb". An event that happened during the user's session.
The Access to XMLHttpRequest... is a browser network error, and it's not exposed to the JS API, so you won't be able to capture it.
If you want to investigate what's available for your network errors, you can use beforeBreadcrumb callback, as detailed in https://docs.sentry.io/platforms/javascript/enriching-events/breadcrumbs/#customize-breadcrumbs

WooCommerce - Auto generating API keys using our Application Authentication Endpoint give 401 Invalid URL error

I'm attempting to use the REST API provided by WooCommerce to generate the Customer Secret and Customer Key values so that it could be used to invoke other WooCommerce REST APIs. I referred the documentation about generating the key values and managed to get it working using a mock endpoint in Postman used for the call_back URL in the API as mentioned in the document.
I created a POST service in my backend server and managed to setup a SSL certificate in the local environment with a domain mapped in hosts file in /etc directory. I ran the backend service and invoked the callback url through Postman and it worked. Then I used that as the call_back URL in the actual WooCommerce Auth endpoint to programatically generate the keys and save it in my DB. But I'm getting
"Access Denied" - Error: A valid URL was not provided..
When I checked the browser through devtools -> network noticed that there is a 401 Unauthorize error.
Here is the sample GET URL that is uesd for WooCommerce API key generation
http://localhost/woocommerce/wc-auth/v1/authorize?app_name=<SOME_NAME>&scope=read_write&user_id=36&return_url=http://localhost/woocommerce/&callback_url=https://foo.bar.dev:44329/api/services/app/woo_commerce_auth/6/callback
callback_url = https://foo.bar.dev:44329/api/services/app/woo_commerce_auth/6/callback
When the callback_url is a mock url generated using Postman it works fine
callback_url = https://513ca6ab-db16-4635-8d0b-9159e3b1e187.mock.pstmn.io/api/services/app/woo_commerce_auth/6/callback
Any clue why this happens, I could not find a way to troubleshoot this issue. Appreciate the help.
Hi posting this for future reference, and hope it would help others who face this problem as well.
Things to keep in mind when setting the callback_url,
Non HTTPS URL endpoint are not allowed.
URL should not be a localhost url (e.g localhost/callback would give an invalid URL error)
URL should not contain port number (e.g localhost:4320/callback or foo.bar.dev:4892/callback are invalid)
Callback URL should be a POST url
If an error such as Error: An error occurred in the request and at the time were unable to send the consumer data. is given after checking all the above check the backend service code related to the callback_url (I had a 500 server error which triggered this, it was not a WooCommerce issue)
Also a tool such as ngrok would be really helpful to setup an HTTPS endpoint in your local environment to test this.

PageSpeed Insights API returning 401 error at seemingly random times

We are programmatically calling the PageSpeed Insights API for an internal list of websites. The majority of the time it works fine, but at seemingly random times we are getting the error "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential..." When the error occurs we log the url that was used for the request as well as the error. As a result I can copy the exact url that generated the error and paste it into a browser (or Postman), https://www.googleapis.com/pagespeedonline/v5/runPagespeed?url=https://www.xyzsite.com/&strategy=mobile&locale=en&key={validAPIkey} for instance, and get a valid response. The fact that the same API key is being used for all requests I know it's valid so I have no idea what might be causing this error. Has anyone else run into this? Does anyone have any idea what might be causing this error to occur on a seemingly random basis?
I also experience the same issue. As on page 5 to 10 API are called with same API key and credentials. Token is also not expired but it generate 401 randonly on different API. See attached image

Data is not returned for every URL input

I am not getting the labels and other properties on all the URL's when using the Google Vision API. It randomly gives this error on some URL.
{'responses': [{'error': {'code': 7, 'message': "We're not allowed to access the URL on your behalf. Please download the content and pass it in."}}]}
As in, on some runs I don't see this error on the URL and get data, and on the other runs I see the error.
Are you trying to access an image on someone else's server? It's possible that they're throttling your access, so that the Vision API can't access the image each time. You may have to slow down your requests.

Google Analytics API Error for inserting unsampled report

I'm using the ruby gem google-api-client version 0.8.6. I've got the account and oauth stuff all set up. I can query the read only aspects of the analytics api, including listing unsampled reports. However, if I try to insert an unsampled report, I get a 400 error: Field title is required.
I am passing in the title, so either this error message is incorrect, or I don't know what.
Here are the params:
{"accountId"=>xxx,
"webPropertyId"=>"UA-xxx-1",
"profileId"=>"xxx",
"title"=>"Browsers",
"start-date"=>"2014-01-01",
"end-date"=>"2014-01-31",
"metrics"=>"ga:pageviews"}
Here is the URL the gem calls:
https://www.googleapis.com/analytics/v3/management/accounts/xxx/webproperties/UA-xxx-1/profiles/xxx/unsampledReports?dimensions=ga%3Abrowser&end-date=2014-01-31&kind=analytics%23unsampledReport&metrics=ga%3Apageviews&start-date=2014-01-01&title=Browsers
The parameters for this request should be sent in the request body, not as query parameters append to the URL. Based on this error, what's probably happening is Google Analytics is looking at the request body, and the first thing it looks for is a title field. When it doesn't find one (since yours are in the URL), it responds with the error saying a title is required.
As far as I can tell, it looks like this gem is incorrectly implementing these API calls. You may want to try just doing the POST yourself in code.
Update: you can try playing around with this method in the APIs Explorer to get a better sense for how the request should be formatted.

Resources