- Introduction
- Computers
- Software
- Printers
- Other Assets
- Audit
- Contracts
- Vendors
- Risks
- Incidents
- Solutions
- Users
API - Contracts
Getting a list of all contracts
This request returns a summary of all contracts in the account.
Request
GET "https://app.samanage.com/contracts.xml"
curl --digest -u "username:password" -H "Accept: application/vnd.samanage.v1+xml" -X GET "https://app.samanage.com/contracts.xml"
Getting contract's details
Request
GET "https://app.samanage.com/contracts/158702.xml"
curl --digest -u "username:password" -H "Accept: application/vnd.samanage.v1+xml" -X GET "https://app.samanage.com/contracts/158702.xml"
Response
<contract>
<type>SoftwareLicense</type>
<end-date>2015-09-01T00:00:00Z</end-date>
<note></note>
<created-at>2009-01-11T18:56:46Z</created-at>
<name>AntiVirus Subscription</name>
<updated-at>2009-01-12T11:09:03Z</updated-at>
<manufacturer>Avast</manufacturer>
<purchases/>
<href>https://app.samanage.com/contracts/158702-antivirus-subscription.xml</href>
<attachments/>
<id>158702</id>
<start-date>2008-01-02T00:00:00Z</start-date>
<items>
<item>
<notes nil="true"></notes>
<created-at>2009-01-11T18:56:46Z</created-at>
<date nil="true"></date>
<name>avast! Antivirus</name>
<updated-at>2009-01-11T18:56:46Z</updated-at>
<rate nil="true"></rate>
<language nil="true"></language>
<quantity>6</quantity>
<tag>avast! Antivirus</tag>
<version>6</version>
</item>
</items>
<attachment>
<content-type>application/pdf</content-type>
<filename>mvls1_Home.PDF</filename>
<height nil="true"></height>
<size>57256</size>
<width nil="true"></width>
</attachment>
<purchases>
<purchase>
<notes></notes>
<created-at>2008-04-29T02:18:20Z</created-at>
<date>2008-04-09T00:00:00Z</date>
<recurrence>One Time</recurrence>
<currency>USD</currency>
<updated-at>2009-07-15T14:33:16Z</updated-at>
<vendor>ASAP Software</vendor>
<total-cost>35000.0</total-cost>
<number>14124</number>
</purchase>
</purchases>
</contract>
Updating a contract
The following request will update contract properties for a specific contract.
PUT "https://app.samanage.com/contracts/158702.xml"
curl --digest -u "username:password" -d @stuff_to_update.xml -H "Content-Type:text/xml" -X PUT "https://app.samanage.com/contracts/158702.xml"
or
curl --digest -u "username:password" -d "<contracts><manufacturer>ABC</manufacturer></contracts>" -H "Content-Type:text/xml" -X PUT "https://app.samanage.com/contracts/158702.xml"
@stuff_to_update is an XML file with the properties you wish to update:
<contracts>
<manufacturer>ABC company</manufacturer>
</contracts>
The following properties can be updated:
Contract record:
name
type
note
manufacturer
start-date
end-date
Within items:
name
quantity
version
date
rate
language
Within purchases:
number
date
total-cost
currency
recurrence
vendor
notes



