trying to get company's basic info through API breaks giving 500 resp code. trying another company token just works! Is this the same issue that's been happening for some company pages for awhile now?
endpoint
https://api.linkedin.com/v1/companies:(id,name,universal-name,logo-url,company-type,industries)?format=json&is-company-admin=true
header:
Authorization: Bearer ****,
response:
{
"errorCode": 0,
"message": "Internal API server error",
"requestId": "JF1034IJDZ",
"status": 500,
"timestamp": 1523938854642
}
Seeing the same problem.
https://api.linkedin.com/v1/companies:(id,name,universal-name,logo-url,square-logo-url)?is-company-admin=true&format=json
The request works normally if you don't include field names:
https://api.linkedin.com/v1/companies?is-company-admin=true&format=json
They've clearly broken the ability to pass field names to the /companies endpoint.
Related
I need to pull GA4 data into client webpages. The site I am working on is written in Coldfusion, so I am not using a client library. The most recent Data API
Migrating to the Google Analytics Data API v1 gives this URL to use without a client library;
https://analyticsdata.googleapis.com/v1beta.
I am getting a 404 error when I POST JSON to
https://analyticsdata.googleapis.com/v1beta/properties/XXXXXXXX:runReport
Has the URL changed?
I am passing in the OAuth access token in the header. I would expect to get a not authorized error if the error was authentication, so it seems that the auth is working. This is the exact error I am getting
"The requested URL /v1beta/properties/XXXXXXXX:runReport was not found on this server. That’s all we know." The status code is 404
Am I missing something blindingly obvious?
I am wondering if you fully read the Migration guide for not using a client libary Did you miss this section?
From what I can see if your code from your comments it looks like you haven't converted things over to GA4 properly. For example you apear to be using a UA metric ga:medium, as well as you still have a viewId in there.
You may want to scan though data api basics
POST https://analyticsdata.googleapis.com/v1beta/properties/GA4_PROPERTY_ID:runReport
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json
{
"dateRanges": [{ "startDate": "2020-09-01", "endDate": "2020-09-15" }],
"dimensions": [{ "name": "country" }],
"metrics": [{ "name": "activeUsers" }]
}
I want to get a list of courses from an audience by HTTP request, I have set the required areas in the project in Google Cloud, but I still get an error when I try to get the courses.
P.S - Please do not offer me documentation and libraries, do not try to convince me, I just need an HTTP request.
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED",
"details": [{
"#type": "type.googleapis.com/google.rpc.ErrorInfo",
"reason": "ACCESS_TOKEN_SCOPE_INSUFFICIENT",
"domain": "googleapis.com",
"metadata": {
"method": "google.classroom.v1.Courses.ListCourses",
"service": "classroom.googleapis.com"
}
}]
}
}
I tried adding ?scope=https://www.googleapis.com/auth/classroom.courses.readonly to the end of the link
Here is the request template
curl \
'https://classroom.googleapis.com/v1/courses?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
Im going to assume that you are using courses list method
The call should look something like this in raw HTTP Request
GET https://classroom.googleapis.com/v1/courses HTTP/1.1
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
The access token ([YOUR_ACCESS_TOKEN]) you are sending must be authorized with the proper scope. If you check the documentation page for the method you are using you will see that you should have authorized the user with one of these scopes
So in your case the error Request had insufficient authentication scopes. means that when you requested authorization you did not request one of the scopes above. There for your access token has insufficient authorization scopes to make the request.
The solution is to reauthorize your user with one of the scopes required by the method in question.
You can read more about how to request authorization and what scopes are in the Using OAuth 2.0 to Access Google APIs documentation page.
Hint: Your very first in the oauth2 flow contains the scope.
https://accounts.google.com/o/oauth2/v2/auth?scope=https://www.googleapis.com/auth/classroom.courses&response_type=code&redirect_uri=http%3A//127.0.0.1%3A9004&client_id=client_id
This video may help you understand scopes Understanding Google OAuth 2.0 with curl since you appear to be using curl and not just raw HTTP calls.
API Post creation responded with status 201 and with a post id urn:li:ugcPost:6767685388107599872. However, the post is not visible on the network and also it's not possible to retrieve the data of the post.
Retrieve endpoint
GET /v2/ugcPosts/urn%3Ali%3AugcPost%3A6767685388107599872?viewContext=AUTHOR
Response
{
"message": "com.linkedin.restli.server.RestLiServiceException [HTTP Status:404]: com.linkedin.content.common.ResponseException: ",
"status": 404
}
Retrieve endpoint
GET /v2/ugcPosts/urn%3Ali%3AugcPost%3A6767685388107599872
Response
{
"message": "com.linkedin.restli.server.RestLiServiceException [HTTP Status:404]: com.linkedin.content.common.ResponseException: ",
"status": 404
}
There was no issue on the Linkedin status page related to the publishing time 2021-02-17T06:05:34.052Z.
I also tried to publish the exact same content on a different page without any problem.
Do you have any idea what could go wrong?
I am trying to send a push notification from my server using Firebase Cloud Messaging but keep getting the following error:
Client error: POST https://fcm.googleapis.com/v1/projects/my-project/messages:send resulted in a 401 Unauthorized response... Request had invalid authentication credentials. Expected OAuth 2 access
I have looked everywhere online and everywhere made mention of "using the Server Key instead of the API Key". I am doing this and still receiving the error. Nothing online has helped.
Here is my request:
POST https://fcm.googleapis.com/v1/projects/my-project/messages:send
Headers:
Authorization: Bearer <MY SERVER KEY>
Content-Type: application/x-www-form-urlencoded (I have also tried application/json)
Body:
{
"message": {
"topic": "",
"notifications": {
"title": "Some title",
"body": "Some notification body"
}
}
}
Push notifications directly from the Firebase console work just fine, I just can't get this to work server side.
It seems you are using the v1 HTTP API, but you're trying to authorize it using the instructions from the legacy API. They aren't compatible. As the documentation states:
Important: The server key found in the console cannot authorize send
requests made via the HTTP v1 API—it is used only for legacy HTTP and
XMPP requests.
If you want to use the v1 API, must follow the instructions in the v1 API documentation. If you don't want to use the v1 API, then you will have to use the legacy API instead.
I am trying to integrate watson from salesforce (Http Callout) and received 404 error. Then I tried the sameusing Postman tool but getting the same result
Added conversation credentials in request header
Request Endpoint
https://gateway.watsonplatform.net/conversation/api/v1/workspaces/883c7704-02c4-41fc-b8a0-aea1d0325c5a/message?version=2016-09-20
Request Body
{
"application/json": {
"input": {
"text": "Hi"
},
"alternate_intents": true
}
}
Response Body
{
"error": "Resource not found"
}
Status
404 Not found
Please let me know what is the issue here. I am not sure whether the way I added version and workspace id in the endpoint went wrong
I had the same issue and I found that it's simply rate limiting that kicks in.
According to the docs here there is no limit for the endpoint, however that turns out to be untrue. If you send a few thousand messages in quick succession, you'll start getting 404 Not Found until the quota resets, which seems to take around 1 hour.
The request body doesn't seem right. It should be JSON with e.g. this structure (see api ref. page in watson conversation service doc.):
{
"input": {
"text": "Hi"
}
}
application/json should be the content type. Sample request with curl:
curl -X POST -u "{username}":"{password}" -H "Content-Type:application/json" --data "{\"input\": {\"text\": \"Hi\"}}" "https://gateway.watsonplatform.net/conversation/api/v1/workspaces/<workspace_id>/message?version=2017-02-10"
See the API Reference for more details: https://www.ibm.com/watson/developercloud/conversation/api/v1/