Created
May 6, 2019 21:20
-
-
Save gomesfellipe/ac1fbdd0746a54a29e679bda0a2e10f9 to your computer and use it in GitHub Desktop.
Exemplo de como implementar a autenticação a partir da resposta da GM5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Exemplo de como implementar a autenticação a partir da resposta da GM5: | |
library(RCurl) | |
headerFields = | |
c(Accept = "text/xml", | |
Accept = "multipart/*", | |
'Content-Type' = "text/xml; charset=utf-8", | |
SOAPAction = "http://tempuri.org/authToken") | |
body = paste0( | |
'<?xml version="1.0" encoding="utf-8"?> | |
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Body> | |
<authToken xmlns="http://tempuri.org/"> | |
<token>',token,'</token> | |
</authToken> | |
</soap:Body> | |
</soap:Envelope>' | |
) | |
reader = basicTextGatherer() | |
curlPerform(url = "https://advertising.criteo.com/API/v201010/AdvertiserService.asmx", | |
httpheader = headerFields, | |
postfields = body, | |
writefunction = reader$update) | |
xml = reader$value() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment