Create UGC Post with Video Asset with LinkedIn V2 API - linkedin

I'm trying to create a UGC post with video asset. I'm able to upload the video and get the media id. but when I'm trying to create the UGC post with the media id, I'm getting a permission error:
urn:li:developerApplication: does not have permission to create ugc posts
Although I am able to create UGC post with an image without any errors.
api url: https://api.linkedin.com/v2/ugcPosts
request budy:
{
"author":"urn:li:organization:",
"lifecycleState":"PUBLISHED",
"specificContent":{
"com.linkedin.ugc.ShareContent":{
"media":[
{
"description":
{
"attributes":[],
"text":"Testing video upload."
},
"media":"urn:li:digitalmediaAsset:",
"status":"READY",
"thumbnails":[],
"title":
{
"attributes":[],
"text":""
}
}
],
"shareCommentary":{
"attributes":[],
"text":"Testing video upload."
},
"shareMediaCategory":"VIDEO"
}
},
"targetAudience":{
"targetedEntities":[]
},
"visibility":{
"com.linkedin.ugc.MemberNetworkVisibility":"PUBLIC"
}
}

Apparently only a few / whitelisted apps can create video UGC posts: https://stackoverflow.com/a/54934631/7844946

Related

Thumbnails not showing up after creating a post via linkedin API call

Thumbnails from external urls are not loading. However, the post inspector tool loads it just fine.
Page I used to perform some tests: https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html
Things I've tried so far:
Add an extra parameter at the end of the url in order to clear linkedin cache.
Post Inspector Tool
I did some research but I wasn't successful on finding a solution.
I created a post using different links like youtube and stackoverflow. Thumbnails didn't show up either.
I made sure each page has those required meta(open graph) tags that allows the crawler to retrieve information.
Here's an example of one of those API requests I've been calling to(I got this from the docs):
`
{
"author": "urn:li:person:{ID}",
"lifecycleState": "PUBLISHED",
"specificContent": {
"com.linkedin.ugc.ShareContent": {
"shareCommentary": {
"text": "Learning more about LinkedIn by reading the LinkedIn Blog!"
},
"shareMediaCategory": "ARTICLE",
"media": [
{
"status": "READY",
"description": {
"text": "Official LinkedIn Blog - Your source for insights and information about LinkedIn."
},
"originalUrl": "https://www.cnbc.com/2022/10/28/more-than-40percent-of-us-households-will-owe-no-federal-income-tax-for-2022.html",
"title": {
"text": "Official LinkedIn Blog"
}
}
]
}
},
"visibility": {
"com.linkedin.ugc.MemberNetworkVisibility": "PUBLIC"
}
}
`
In the Share Media object, you're missing the media attribute. It accepts LinkedIn URN so you'll need to upload the image. Personally, I'm not using that attribute but thumbnails that accepts image url. I don't see it in the docs anymore so something might have been changed. At least it's still working for me and I haven't seen it deprecated in the changelog yet. Be careful with the image requirements as well. It accepts an image url with this signature
{
...,
"thumbnails": [{
"url": "https://image-url.com"
}]
}

Frontity Woocommerce

I am new to the use of Frontity, but I do have a few questions, I hope this is the right place for it!.
Can someone explain me how to :
List products with Frontity.
Show variable products with Frontity
The use of REST API in Frontity.
Here is where you put in the API - its basically just your website URL plus wp-json.
"name": "#frontity/wp-source",
"state": {
"source": {
"api": "https://test.frontity.org/wp-json"
}

Using the LinkedIn API to update a profile header/background image

I am pretty new to the LinkedIn API. Does anyone know if there is a way to access a users profile header image/background image through the LinkedIn API? I have looked through the documentation and I cannot find it.
Also, if anyone has a good ASP.NET package that is built to work with LinkedIn so I don't have build the plumbing - would also love a recco.
Thanks.
JJO
linkedin
I found API documentation in https://learn.microsoft.com/en-us/linkedin/shared/integrations/people/profile-edit-api?context=linkedin/compliance/context#background-picture
Unfortunately, it's a complex process with 3 stes:
Register the background picture image to be uploaded.
1.1 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-originalbackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
1.2 POST https://api.linkedin.com/v2/assets?action=registerUpload
{
"registerUploadRequest": {
"recipes": [
"urn:li:digitalmediaRecipe:profile-displaybackground-image"
],
"owner": "urn:li:person:ABCDEF",
"serviceRelationships": []
}
}
Upload the background picture image to LinkedIn.
curl -i --upload-file /Users/peter/Desktop/superneatimage.png --header "Authorization: Bearer redacted" 'https://api.linkedin.com/mediaUpload/C5616AQEoeGkp7U5GEA/profile-uploadedBackgroundImage/0?ca=vector_profile&cn=uploads&m=AQIdKBw1WIgAWwAAAWhdlwvlhH13JEO0ZxBHb2VRuyAILbzD_VgJ-4UyLg&app=5480656&sync=0&v=beta&ut=1SpRkaq8G5DoA1'
Update the member's profile.
Use the asset from Step 1 to update the profile with the new background picture.
{
"patch": {
"backgroundPicture": {
"$set": {
"originalImage": "urn:li:digitalmediaAsset:C5604AQEMWf4Nl_mf2g",
"displayImage": "urn:li:digitalmediaAsset:C5616AQEoeGkp7U5GEA"
}
}
}
}

WordPress + Gatsby Custom Rest Route Not Showing in GraphQL

I'm fairly new to Gatsby and Im trying to build a site using WP as the content provider. I have a custom rest route built in WP
wp-json/lbt/v1/settings
and right now its just returning
{
"time_and_location": "Testing"
}
I cant seem to find out how to get that route to be available in graphQL for my Gatsby site. I have it set in my includedRoutes as
includedRoutes: [
'/*/*/categories',
'/*/*/posts',
'/**/lbt/**',
'/*/*/events',
'/*/*/pages',
'/*/*/media',
'/*/*/tags',
'/*/*/taxonomies',
'/*/*/menus'
],
I also see this when I spin up Gatsby
-> wordpress__lbt_v1 fetched : 1
-> wordpress__lbt_settings fetched : 1
I've searched a lot of different sites, but I haven't managed to find anything. Any help appreciated.
you need to add custom normalizer in "gatsby-config.js"
like
...
plugins: [
.....,
{
resolve: "gatsby-source-wordpress",
options: {
......
normalizers: normalizers => [ mapCustomApis,...normalizers],
}
}
......
add the "mapCustomApis" normalizer like
const mapCustomApis = {
name: `mapCustomApis`,
normalizer: function({ entities }) {
return entities.reduce((acc, e) => {
return acc.concat(e);
}, []);
}
}
i replicated the code from https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-source-wordpress/src/normalize.js#L102
to support my custom Apis response
make sure your normailzer is before the rest of the normalizers

Retrieve thumbnails for Linkedin Video Post (ugcPost API)

I try to retrieve a thumbnails for a Video Post with the ugcPost api without any success.
I retrieve always an empty array for thumbnails.
Regarding the doc Retrieve UGC Posts, like the sample response:
"com.linkedin.ugc.ShareContent": {
"media": [
{
"media": "urn:li:digitalmediaAsset:123ABDEFHAG",
"status": "READY",
"thumbnails": []
}
],
Any idea about how to retrieve a thumbnails with some projection or using the digitalmediaAsset urn?
EDIT: I've already tried this https://stackoverflow.com/a/58401470/2270041 without any success
According to the docs this is not possible, simply stating
Video thumbnails are not retrievable.

Resources