Skip to content

Instantly share code, notes, and snippets.

@pvillega
Last active August 29, 2015 14:14
Show Gist options
  • Save pvillega/aa21f7ef609fd210627a to your computer and use it in GitHub Desktop.
Save pvillega/aa21f7ef609fd210627a to your computer and use it in GitHub Desktop.
Example of 'packages' request and payload
Given the following request to a QA bapi instance, signed as specified in the document we sent:
http://bapi.qa8.gumtree.com/api/accounts/101981/packages?timestamp=1422961797794&signature=3d311860aa1bf1bd912ff0880102999f9c46a3670e8fb7ea9f71f112cb72e1a1&apiKey=c7deb878d73c3d3468a53a16f2c4232d
Your response will have the following headers:
Content-Type → application/json;charset=UTF-8
Date → Tue, 03 Feb 2015 11:10:44 GMT
Server → GumBackend
Transfer-Encoding → chunked
The payload in the body (Json) will be as follows:
{
"packages": [
{
"id": 2000103,
"package_type_id": 47,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 0,
"name": "Housing url, London",
"unlimited": true
},
{
"id": 2000097,
"package_type_id": 35,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 0,
"name": "Motors Subscription, 3 month, RoUK",
"unlimited": false
},
{
"id": 2000098,
"package_type_id": 32,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 0,
"name": "Housing Subscription, 12 month, London",
"unlimited": true
},
{
"id": 2000099,
"package_type_id": 37,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 0,
"name": "Motors Subscription, 1 month, RoUK",
"unlimited": false
},
{
"id": 2000100,
"package_type_id": 1,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Standard ad in Jobs, London",
"unlimited": false
},
{
"id": 2000093,
"package_type_id": 8,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 2,
"adjusted_credits": 0,
"used_credits": 2,
"name": "2 free job ads per year outside London",
"unlimited": false
},
{
"id": 2000102,
"package_type_id": 46,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Housing url, RoUK",
"unlimited": true
},
{
"id": 2000096,
"package_type_id": 34,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Motors Subscription, 18 month, London",
"unlimited": false
},
{
"id": 2000104,
"package_type_id": 48,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Jobs url, RoUK",
"unlimited": false
},
{
"id": 2000101,
"package_type_id": 9,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Standard ad in Jobs outside London",
"unlimited": false
},
{
"id": 2000105,
"package_type_id": 49,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 1,
"name": "Jobs url, London",
"unlimited": false
},
{
"id": 2000095,
"package_type_id": 33,
"account_id": 101981,
"start_date": "2013-10-18T00:00:00Z",
"end_date": "2014-10-19T00:00:00Z",
"initial_credits": 100,
"adjusted_credits": 0,
"used_credits": 2,
"name": "Housing Subscription, 12 month, RoUK",
"unlimited": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment