PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV 2024
→
Contact Google via l'API People
Contact Google via l'API People
Started by christophe, Oct., 08 2019 6:21 PM - 1 reply
Connect yourself…
christophe
#1
Posted on October, 08 2019 - 6:21 PM
Bonjour,
A cause d'un dysfonctionnement sur la gestion des contacts google avec les fonctions windev (le nom du contact n'est pas renseigné lorsqu'on ajoute un contact) je souhaite utiliser l'api people. Je rencontre cependant un problème
Je récupère bien mon token avec la fonction AuthIdentifie, par contre lorsque je lance ma requête http pour ajouter mon contact j'ai une erreur 403 ("Request had insufficient authentication scopes."). A priori il me manque le scope "
https://www.googleapis.com/auth/contacts
".
Je ne vois pas où je peux l'ajouter. Quelqu'un peut-il m'aider ?
Le code que j'utilise :
toto
est un OAuth2Paramètres
toto
..
ClientID
=
"monidclientgoogle"
toto
..
ClientSecret
=
"monclientsecretgoogle"
toto
..
URLAuth
=
"https://accounts.google.com/o/oauth2/auth"
toto
..
URLRedirection
=
"http://localhost:15000"
toto
..
URLToken
=
"https://oauth2.googleapis.com/token"
toto
..
Scope
=
"profile email"
MonToken
est un AuthToken
=
AuthIdentifie
(
toto
)
SI
ErreurDétectée
ALORS
Erreur
(
ErreurInfo
)
FIN
req
est un httpRequête
req
..
Méthode
=
httpPost
//req..AuthToken = MonToken // Token d'authentification
req
..
ContentType
=
"application/json"
req.URL
=
"https://people.googleapis.com/v1/people:createContact"
req.Entête
[
"Authorization"
]
=
"Bearer "
+
MonToken.Valeur
j
est un
JSON
j.addresses
[
1
]
.
streetAddress
=
"monadresse"
j.addresses
[
1
]
.
city
=
"maville"
j.addresses
[
1
]
.
postalCode
=
"moncodepostal"
j.addresses
[
1
]
.
type
=
"work"
j.names
[
1
]
.
familyName
=
"monnom"
j.names
[
1
]
.
givenName
=
"monprenom"
j.phoneNumbers
[
1
]
.
value
=
"montelephone"
j.phoneNumbers
[
1
]
.
type
=
"work"
j.phoneNumbers
[
2
]
.
value
=
"monmobile"
j.phoneNumbers
[
2
]
.
type
=
"mobile"
j.emailAddresses
[
1
]
.
value
=
"monemail.com"
j.emailAddresses
[
1
]
.
type
=
"work"
req.Contenu
=
j
réponseHTTP
est un httpRéponse
=
HTTPEnvoie
(
req
)
Merci.
Report
0
0
Alain BLAIZEAU
#2
Registered member
29 messages
Popularité : +3 (3 votes)
Posted on October, 14 2019 - 10:20 AM
Bonjour,
Tu as essayé
toto..Scope="contacts" ?
Report
0
0
→ Go back to WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
WEBDEV (earlier versions)
WINDEV Mobile (earlier versions)
Reports & Queries
Off-topic
Tools
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text