LinkedIn API Share Content with symfony return 403 - linkedin-api

I want to connect one app to linkedin in order to share content for a company page. I use symfony 5.4 in order to.
I do the following step:
create a code : ok
create a token : ok
get user credential with the token : ok
I send this request:
yes here is the response I get :
TraceableHttpClient->request('POST', 'https://api.linkedin.com/v2/ugcPosts', array('headers' => array('Authorization: Bearer AQWkl2rmtRNpKP6ir_n_y7GloBnUJI--gp6hy0xxxxxxx-xxxxx-xxxxx-LedwHSBHATYSN3878kPadWjVH9Fm-_NdDnEau0rpElZe2C4UglKTpFFZDIs2tpT1o1N_oYjWwl6AmaduaG_1v-ZS76BKrR2RLxhvDhBaqTA9U_kIWleQPpRfV_hYGYZn5ILHbSOw6PnfxFo_3UulB-8QyyeS00W8l1pAKr3cVpqxsDhfPFYZLazIGFePfaEFxlqEqZsJjSrj1jUewejLzdojs8gqcqY8_-DKexWCCuNMsFdOQNMCs5XFjw', 'X-Restli-Protocol-Version' => '2.0.0'), 'json' => array('author' => 'urn:li:person:2aw2xskWL5', 'lifecycleState' => 'PUBLISHED', 'specificContent' => array('com.linkedin.ugc.ShareContent' => array('shareCommentary' => array('text' => 'L\'assistant marketing supervise la gestion des plannings et de l\'agenda de ses supérieurs, de l\'organisation de rencontres ou des déplacements. • Occasionnellement, il peut être amené à faire de la prospective par téléphone (phoning) ou par email (mailing). • Avec le chargé d\'études, il peut mener des analyses statistiques et assurer une veille des activités de la concurrence et en matière règlementaire.'), 'shareMediaCategory' => 'NONE')), 'visibility' => array('com.linkedin.ugc.MemberNetworkVisibility' => 'PUBLIC')), 'on_progress' => object(Closure))
But when I want to share a post it throws the following error :
HTTP/1.1 403 Forbidden returned for "https://api.linkedin.com/v2/ugcPosts".
The user in linkedin has admin right on the company page and the app has the following right : r_emailaddress, r_liteprofile, w_member_social
My guess is that OAuth 2.0 scopes needs to be changed but I cannot find out where to allow access to the functionality.

I found the origin of the problem.
While requesting the token, I did not grant « share » right to it.
Every thing works fine.

Related

Show all burndown projects with the tuleap API

English :
Hello everybody !
Do you know if it is possible to recover from the API of the project planning and management tool "Tuleap" the burndown urls of all the projects to which the original user of the request has access?
After several searches in the documentation of the tool and on the internet, I still can not find an answer.
Thank you for the help you can give me! :)
Français :
Bonjour tout le monde !
Savez-vous s'il est possible de récupérer à partir de l'API de l'outil de planification et gestion de projet "Tuleap" les urls des burndown de l'intégralité des projets auxquels à accès l'utilisateur originaire de la requête ?
Après plusieurs recherche dans la documentation de l'outil et sur internet, je n'arrive toujours pas à trouver de réponse.
Merci pour l'aide que vous pourrez m'apporter ! :)

How do I get French accents to show up properly in a mailto?

I've got a mailto link with body copy. The content is all in French. Unfortunately its showing funny characters instead of the accents that I need.
<a title="Prospects" href="mailto:?subject=Pourquoi ne pas investir dans les bons conseils?&body=Madame, Monsieur,%0D%0A%0D%0AÊtes-vous en voie d'atteindre vos objectifs financiers?%0D%0A%0D%0ADes recherches ont révélé que les investisseurs bénéficiant de conseils professionnels s'en tirent beaucoup mieux financièrement. En fait, il a été démontré récemment que ceux faisant appel à un conseiller accumulent presque quatre fois plus d'actifs que les autres.%0D%0A%0D%0AN'hésitez pas à communiquer avec moi pour prendre rendez-vous et en discuter. Veuillez agréer mes plus cordiales salutations.%0D%0A%0D%0ASincerely,%0D%0A%0D%0A<Conseiller>" class="resource_btn"><i class="fa fa-envelope"></i>Prospection</a>
Any help would be appreciated!
I tried encoding the email
https://jsfiddle.net/765rotvu/
https://jsfiddle.net/f8tabmmf/
There's javascript function escape to encode html.
Example:
javascript:escape('Êtes-vous là, où étiez-vous ?');
Result is
%CAtes-vous%20l%E0%2C%20o%F9%20%E9tiez-vous%20%3F

ColdFusion and Unicode Characters Issues

Working on the Globalization of the Coldfusion website using the i18n.
I am using the resource files rather than database..
In my one of the string files, i have the value being displayed as:
Inicia sesión con tu nombre de usuario y contraseña.
and when i run on my browser, it is displayed as:
Inicia sesi�n con tu nombre de usuario y contrase�a.
Having read the below link, i have enabled the utf through cfprocessingdirective and the meta tag also, but i am not sure why it is still displaying it like this.
ColdFusion character encoding issue
I used the Google translate to translate the above English to Spanish.
Using this in my Application.cf also:
<cfset setLocale("English (US)")>
<!--- Set the session page encoding --->
<cfset setencoding("URL", "utf-8")>
<cfset setencoding("Form", "utf-8")>
Update #1
I cannot Update, but i am adding here:
spanish:
username=Nombre de usuario
login=Inicia sesión con tu nombre de usuario y contraseña.
appName=Inventory Manager
rem=Acuérdate de mí
slogin=Iniciar sesión
errorLoginMsg=Error! Credenciales de login fallidos, Inténtalo de nuevo
ser='Nombre de usuario' es un campo obligatorio.
ser1='Password' es un campo obligatorio.
nitem=Nuevo elemento
ilist=Lista de artículos
order=Orden
olist=Lista de Pedidos
sell=Vender
slist=Lista de Ventas
quote=Cotizaciones
qlist=Lista Cotizaciones
rs=Vuelto Vendido
inv=Factura
Russian File it is ru.rtf
username=Имя пользователя
login=Войти с именем пользователя и паролем.
appName=Inventory Manager
rem=Запомнить меня
slogin=войти
errorLoginMsg=Ошибка! Учетные данные для входа не удалась, попробуйте еще ​​раз
ser='Имя' является обязательным полем.
ser1=Поле 'Пароль' является обязательным.
nitem=Новый элемент
ilist=Список статей
order=Заказать
olist=Список Заказать
sell=Продать
slist=Список продажам
quote=Цитаты
qlist=Котировки Список
rs=Продано Возвращается
inv=Счет

Get form names in windev

I use Itextsharp in WinDev and I try to get the names of a form.
My code is hereafter :
Machaine est une chaine
PdfSource= FicSource
PdfDestination = RepCible+"\"+fExtraitChemin(PdfSource,fFichier)+" "+CodId+".pdf"
MonStream = allouer un FileStream(PdfDestination,FileMode::Create)
MonPdfReader est un PdfReader(PdfSource)
POUR TOUT MaChaine DANS MonPdfReader.AcroFields.Fields.Keys
FIN
The problem is that
"MonPdfReader.AcroFields.Fields.Keys"
is not accepted.
Thanks for your ideas ...
As you didn't answer your question, here it is :
PdfSource = Sai_FicSource
//file pdf source
MonPdfReader est un PdfReader(PdfSource)
Monfield est un AcroFields.Item
POUR TOUT Monfield DE MonPdfReader.AcroFields.Fields.Keys
MaChaine = Monfield
FIN

nltk in python to extract information from web page

how can I use nltk in python to extract information from web page (job offers in my case)
I use this code to extract a part of text ,
import nltk
import time
import urllib2
from urllib2 import urlopen
from cookielib import CookieJar
import datetime
website = "http://tanitjobs.com/search-results-jobs/"
topSplit = "<div class=\"offre\">"
ButtomSplit = "<div class=\"offre-emploi \">"
cj = CookieJar()
opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj))
opener.addheaders = [('Uer-agent', 'Mozilla/5.0')]
def main():
try:
ss =opener.open(website).read()
sourceCodeSplit = ss.split(topSplit)[1].split(ButtomSplit)[0]
texte = nltk.clean_html(sourceCodeSplit)
print texte
except Exception,e:
print 'fail in the main loop'
print str(e)
main()
but I don't know how to do it if I would extract specific paragraph (job offers) from a web page in general
Firstly, you will need urllib.request from python3, see http://docs.python.org/3.0/library/urllib.request.html
Next, BeautifulSoup is your friend: http://www.crummy.com/software/BeautifulSoup/bs4/doc/. I find this useful in installing bs4 in py3.x see http://annelagang.blogspot.fr/2012/11/beautifulsoup-4-for-python-3x.html
Here's a working example:
import urllib.request
from bs4 import BeautifulSoup as bs
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
headers={'User-Agent':user_agent,}
url="http://tanitjobs.com/search-results-jobs/"
request=urllib.request.Request(url,None,headers) #The assembled request
response = urllib.request.urlopen(request)
data = response.read()
for i in bs(data).find_all(attrs={"class": "offre-emploi vedette"}):
print(" ".join(i.find("div",attrs={"class":"detail"}).text.split()))
print
[out]:
Téléopérateurs (trices) Quality Com Center QualityCom sis a
Montplaisir recrute des téléopérateurs (trices), en... Voir toutes les
offres de Quality Com Center
Contrôleur de gestion Eureka Developpement Humain Pour le compte d’une
Multinationale dans le domaine de l'industrie, nous recrutons un :...
Voir toutes les offres de Eureka Developpement Humain
Responsable ressources humaines (H/F) Eureka Developpement Humain Pour
son propre compte Eureka Développement Humain Recrute : Responsable...
Voir toutes les offres de Eureka Developpement Humain
Contrôleur Financier Junior Proxy Tunisie Rattaché au Directeur
Administratif et Financier pays, votre rôle est de garantir la
gestion... Voir toutes les offres de Proxy Tunisie
Superviseur en prise de rdv ( énergie renouvelable ) Quality Com
Center Quality Com Center sis a Montplaisir Recrute 1 Superviseur(e)
en Panneaux... Voir toutes les offres de Quality Com Center
Téléconseillers (h/f) Axess global services AXESS GLOBAL SERVICES
Recrutement Vous souhaitez travailler dans une Enterprise jeune et...
Voir toutes les offres de Axess global services