LinkedIn Share API creates a share but returns error 500 - api

I'm asking this question on SO, since LinkedIn support is officially moved here.
I'm receiving HTTP 500 response from LinkedIn API endpoint while trying to create a share. This happens sporadically, but it is a quite often event last week or two. The weird part is that the share being created successfully.
Please advise. Could it be caused by spiking users activity on social media due to COVID19?
For the reference, here is request body POST-ed to https://api.linkedin.com/v2/shares (real ids are replaced).
{
"owner": "urn:li:organization:111111",
"text": {
"text": "Text text text"
},
"content": {
"contentEntities": [
{
"entity": "urn:li:digitalmediaAsset:111111"
}
],
"shareMediaCategory": "IMAGE"
},
"distribution": {
"linkedInDistributionTarget": {
"connectionsOnly": false,
"visibleToGuest": true
}
}
}
Response:
{
"message": "Internal Server Error",
"status": 500
}

Related

403 Error creating dataSource for com.google.blood_pressure in Google Fit REST API

Goal:
I have a simple web application where I submit my Blood Pressure and Heart Rate measurements.
Now I'd like to submit these measurements to my Google Fit Account.
I tried Googles tutorial: https://developers.google.com/fit/scenarios/write-bp-data
OAuth2 Setup
I created new credentials in one of my existing Cloud Console Projects. And then requested a new authorization code using the following scopes (The project is in Testing State and my account is registered as tester):
https://www.googleapis.com/auth/fitness.blood_pressure.write
https://www.googleapis.com/auth/fitness.heart_rate.write
Requesting the token returns the following response:
{
"access_token": "ya29.XXXXXXXXXXXXXXXX",
"expires_in": 3599,
"refresh_token": "1//XXXXXXXXXXXXXXXX",
"scope": "https://www.googleapis.com/auth/fitness.heart_rate.write https://www.googleapis.com/auth/fitness.blood_pressure.write",
"token_type": "Bearer"
}
As you can see, both write scopes are granted.
Additionally, if I check the permissions in my Google Account, both scopes are set.
Create dataSource
Now I create two dataSources (one for com.google.heart_rate.bpm and one for com.google.blood_pressure).
creating the Heart Rate dataSource works as expected, but creating a dataSource for Blood Pressure returns a 403 PERMISSION_DENIED Error:
Request (POST https://www.googleapis.com/fitness/v1/users/me/dataSources)
{
"dataStreamName": "BPA-BloodPressure",
"type": "raw",
"application": {
"detailsUrl": "https://aaa.bbb.ccc",
"name": "Blood Pressure App",
"version": "1"
},
"dataType": {
"name": "com.google.blood_pressure"
}
}
Response
{
"error": {
"code": 403,
"message": "Scope not included to modify data of type com.google.blood_pressure. Possible scopes: https://www.googleapis.com/auth/fitness.blood_pressure.write",
"errors": [
{
"message": "Scope not included to modify data of type com.google.blood_pressure. Possible scopes: https://www.googleapis.com/auth/fitness.blood_pressure.write",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
}
The Google Fit REST API tells me that the Scope fitness.blood_pressure.write is missing, but as you can see the Scope is given for the used access token.
Notes
I am working with Postman to test all requests. Later a Java/Groovy or PHP backend will used.
I also tried with read and write scopes for both data types.
I can see my app with both write scopes in Google Fit under "Connected apps".
Change dataType name to "fitness.blood_pressure" instead of "com.google.blood_pressure"
The body will be like this.
{
"dataStreamName": "BPA-BloodPressure",
"type": "raw",
"application": {
"detailsUrl": "https://aaa.bbb.ccc",
"name": "Blood Pressure App",
"version": "1"
},
"dataType": {
"name": "fitness.blood_pressure"
}
}

Mimecast API authentication issue

trying to connect to endpoint with all needed headers defined:
https://us-api.mimecast.com/api/login/login.
Error message receieved : 0018 Client update required
Did anyone encounter/solve this issue?
{
"meta": {
"status": 401
},
"data": [],
"fail": [
{
"key": {
"username": "datadash#itprosusa.com",
"tokenType": "key",
"verifyOnly": false
},
"errors": [
{
"code": "err_xdk_client_update_required",
"message": "0018 Client update required",
"retryable": false
}
]
}
]
}
I came across the same error message when trying to get Access key and Secret Key. You can actually get these in the Mimecast portal UI by going to: Administration | Services | API Applications, then Add API Application fill in the details and wait 30 minutes. After 30 minutes click on your newly created API application and select Create Keys, fill in the required information and it will provide you with your Access key and Secret key used for API calls.
If this doesn't answer your question or help you I would suggest getting in contact with Mimecast Support, they are usually pretty good!

"Updated" notification type for Microsoft Graph deleted user

After delete user from Active Directory(AD) got this notification (using Microsoft Graph subscription):
{
"value": [
{
"changeType": "updated",
"clientState": null,
"resource": "Users/{user-id}",
"resourceData": {
"#odata.type": "#Microsoft.Graph.User",
"#odata.id": "Users/{user-id}",
"id": "{user-id}",
"organizationId": "{organisation-id}",
"sequenceNumber": hidden
},
"subscriptionExpirationDateTime": "2019-01-17T12:48:43.7825578+00:00",
"subscriptionId": "hidden",
"tenantId": "hidden"
}
]
}
Next tried to get this user from Microsoft Graph
/GET https://graph.microsoft.com/v1.0/users/{user-id}
And got
{
"error": {
"code": "Request_ResourceNotFound",
"message": "Resource '{user-id}' does not exist or one of its queried reference-property objects are not present.",
"innerError": {
"request-id": "{user-id}",
"date": "2019-01-15T13:41:49"
}
}
}
why notification came with changeType = "updated" if user not exists?
When a user is deleted from the directory, they are "soft-deleted" (which means the object can still be access - see below, and restored). This type of change is modeled as an 'update'. We plan to improve that in future versions.
A resource will be finally hard-deleted (typically after 30 days), and when that happens you will see a 'deleted' notification.
Soft-deleted users cannot be access using users/id - hence the error you are seeing.
However, soft-deleted resources in Azure AD can be accessed using the special deletedItems API:
https://learn.microsoft.com/en-us/graph/api/directory-deleteditems-get?view=graph-rest-1.0

Foursquare API - Tastes

When I try to send a GET request to Foursquare API below, I get "No matching endpoint." error.
I have validated my tokens and everything seems normal. Any advices?
REQUEST URL
https://api.foursquare.com/v2/users/USER_ID/tastes
RESPONSE MESSAGE
{
"meta": {
"code": 404,
"errorType": "endpoint_error",
"errorDetail": "No matching endpoint"
},
"notifications": [
{
"type": "notificationTray",
"item": {
"unreadCount": 0
}
}
],
"response": {}
}
FoursquareAPI twitter account has told me that I needed to pass m=foursquare in addition to version information.
The correct endpoint information is like
https://api.foursquare.com/v2/users/USER_ID/tastes?oauth_token=TOKEN&v=20150420&m=foursquare
The detailed information about v and m parameters are below.
https://developer.foursquare.com/overview/versioning

Instagram API getting error on UTF-8 characters (tested on /tags/{TAGNAME}/media/recent)

Shamelessly stolen from this ( https://groups.google.com/forum/#!topic/instagram-api-developers/tRfU444ZyhU ) thread as I have the exact same issue and hoping for better responses here.
Long story short, a few hours ago this was working, now it isn't.
The test platform can be found at both from my website and https://apigee.com/console/instagram
Sending https://api.instagram.com/v1/tags/türkiye/media/recent (careful with the "ü")
result: {
"meta": {
"error_type": "OAuthParameterException",
"code": 400,
"error_message": ""client_id" or "access_token" URL parameter missing. This OAuth request requires either a "client_id" or "access_token" URL parameter."
}
}
Sending https://api.instagram.com/v1/tags/turkiye/media/recent (now with "u")
result: {
"pagination": {},
"meta": {},
"data": [
{},
{},
{},
{},.. .. .. ... and so on
Sending https://api.instagram.com/v1/tags/türkiye/media/recent?client_id=7176aa6ef2fd47fd9cb373a5354bd30f ("ü" again and this time manually attached client_id)
result: {
"meta": {
"code": 200
},
"data": {
"media_count": 1471127,
"name": "t"
}
}
This time I'm getting the name as "t". It seems the query is broken just before the "ü" letter which is UTF-8 (Turkish if needed).
This is a bug on Instagram-side. There's an open discussion on Instagram Developers Google group. Although, from what I've seen in my application, the bug now resolve.