Created
July 31, 2013 15:39
-
-
Save callemall/6123130 to your computer and use it in GitHub Desktop.
Making use of the GetListContents function, this example shows how to retrieve contact list entries.
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
#!/bin/bash | |
( | |
cat <<EOF | |
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://wwCw.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> | |
<soap:Body> | |
<GetListContents xmlns="http://call-em-all.com/"> | |
<myRequest> | |
<username>##U##</username> | |
<pin>##P##</pin> | |
<listID>##L##</listID> | |
</myRequest> | |
</GetListContents> | |
</soap:Body> | |
</soap:Envelope> | |
EOF | |
) > GetListContents.xml | |
( | |
cat <<EOF | |
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> | |
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> | |
<xsl:template match="soapenv:Body"> | |
<xsl:copy-of select="child::node()"/> | |
</xsl:template> | |
</xsl:stylesheet> | |
EOF | |
) > cleanit.xsl | |
clear | |
echo | |
echo | |
echo -n "Enter your Username : " | |
read username | |
echo | |
echo -n "Enter your pin (will not echo) :" | |
read -s pin | |
echo | |
echo | |
echo -n "Enter the ListID to retrieve :" | |
read listid | |
echo | |
cat GetListContents.xml | sed -e s/##U##/"$username"/g | sed -e s/##P##/"$pin"/g | sed -e s/##L##/"$listid"/g > glc.xml | |
clear | |
curl -H "Content-Type: text/xml; charset=utf-8" \ | |
-H "SOAPAction:http://call-em-all.com/GetListContents" \ | |
[email protected] \ | |
http://staging-api.call-em-all.com/webservices/ceaapi_v2.asmx | xsltproc cleanit.xslt - | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment