ProposalPath API
The ProposalPath API is implemented as vanilla XML over HTTP.
To create a proposal, your application makes an HTTP POST to https://proposalpath.com/api/create with XML data as specified in the example below.
Required fields: title, start_date, end_date (must be same or later than start date), customer_name, customer_contact, customer_email
If the request is successful, we send back a document ID which can be used to request the same document in the future.
Example using curl:
curl -H 'Accept: application/xml' -H 'Content-Type: application/xml' -d @data.xml https://proposalpath.com/api/create
where data.xml contains:
Request
<request>
<user>ProposalPath username</user>
<key>API key</key>
<start-date type="date">2012-07-21</start-date>
<end-date type="date">2012-07-24</end-date>
<customer-name>Acme Corp</customer-name>
<customer-contact>Ryan Hamilton</customer-contact>
<customer-title>Meeting Planner</customer-title>
<customer-address>123 Main Street, Chicago, Illinois</customer-address>
<customer-phone>(312) 555-1212</customer-phone>
<customer-email>ryan@bluebuzzard.com</customer-email>
<title>Annual Sales Meeting</title>
<rooms>
<room>
<date>2012-07-22</date>
<rate>159.00</rate>
<quantity>40</quantity>
<room-type-id>Single</room-type-id>
</room>
<room>
<date>2012-07-23</date>
<rate>159.00</rate>
<quantity>40</quantity>
<room-type-id>Single</room-type-id>
</room>
</rooms>
<meetings>
<meeting>
<date>2012-07-21</date>
<rate>349.00</rate>
<start>8a</start>
<end>5p</end>
<function>Meetings</function>
<setup>40 / Rounds</setup>
<room>Oak</room>
</meeting>
<meeting>
<date>2012-07-21</date>
<rate>159.00</rate>
<start>12p</start>
<end>1p</end>
<function>Lunch</function>
<setup>40 / Rounds</setup>
<room>Cafe</room>
</meeting>
</meetings>
</request>
Response
<response success="true">
<document-id>123456</document-id>
</response>
Basic .NET Example
string url = "http://proposalpath.com/api/create";
HttpWebRequest req = WebRequest.Create(url) as HttpWebRequest;
req.Accept = "application/xml";
req.ContentType = "application/xml";
req.Method = "POST";
req.AllowAutoRedirect = true;
StreamWriter writer = new StreamWriter(req.GetRequestStream());
writer.WriteLine(System.IO.File.ReadAllText("C:\\path\\to\\sample\\data.xml"));
writer.Close();
StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream());
string data = reader.ReadToEnd().Trim();
reader.Close();
return data;