Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gomesfellipe/ac1fbdd0746a54a29e679bda0a2e10f9 to your computer and use it in GitHub Desktop.
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
# 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