Profile¶
Allowed HTTP methods¶
Method | Description |
---|---|
GET | get the profile object |
PUT | update the profile object |
Note
See RFC 2616 for more details on HTTP methods semantics
Listing¶
- GET /profile/¶
Gets the user profile. Note that profile is a single object so the API does not return a list.
statuscode 200: | no error |
---|
Example request:
GET /api/2.0/profile/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"address": "1 Main str.",
"api_https_only": false,
"autotopup_amount": "200.0000000000000000",
"autotopup_threshold": "200.0000000000000000",
"bank_reference": "jdoe123",
"clone_naming": "NONE",
"company": "",
"country": "BG",
"currency": "USD",
"email": "user@example.com",
"first_name": "John",
"has_autotopup": false,
"invoicing": true,
"key_auth": false,
"language": "en-au",
"last_name": "Doe",
"mailing_list": true,
"meta": {},
"my_notes": "2014-06-05 08:15:39.864947",
"nickname": "",
"phone": "",
"postcode": "1000",
"reseller": "",
"signup_time": "2013-05-28T11:57:01.090639+00:00",
"state": "REGULAR",
"tax_name": null,
"tax_rate": null,
"title": "Mr",
"town": "Sofia",
"uuid": "6f670b3c-a2e6-433f-aeab-b976b1cdaf03",
"vat": "123"
}
Editing¶
- PUT /profile/¶
statuscode 200: | no error |
---|
Edits a user profile. (We want to change the company name for example)
Example request:
PUT /api/2.0/profile/ HTTP/1.1
Content-Type: application/json
Authorization: Basic SWYgeW91IGZvdW5kIHRoaXMsIGhhdmUgYSBjb29raWUsIHlvdSBkZXNlcnZlIGl0IDop
{
"address": "1 Main str.",
"api_https_only": false,
"autotopup_amount": "200.0000000000000000",
"autotopup_threshold": "200.0000000000000000",
"bank_reference": "jdoe123",
"clone_naming": "NONE",
"company": "Newly Set Company Name",
"country": "BG",
"currency": "USD",
"email": "user@example.com",
"first_name": "John",
"has_autotopup": false,
"invoicing": true,
"key_auth": false,
"language": "en-au",
"last_name": "Doe",
"mailing_list": true,
"meta": {},
"my_notes": "2014-06-05 08:15:39.864947",
"nickname": "",
"phone": "",
"postcode": "1000",
"reseller": "",
"signup_time": "2013-05-28T11:57:01.090639+00:00",
"state": "REGULAR",
"tax_name": null,
"tax_rate": null,
"title": "Mr",
"town": "Sofia",
"uuid": "6f670b3c-a2e6-433f-aeab-b976b1cdaf03",
"vat": "123"
}
Example response:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"address": "1 Main str.",
"api_https_only": false,
"autotopup_amount": "200.0000000000000000",
"autotopup_threshold": "200.0000000000000000",
"bank_reference": "jdoe123",
"clone_naming": "NONE",
"company": "Newly Set Company Name",
"country": "BG",
"currency": "USD",
"email": "user@example.com",
"first_name": "John",
"has_autotopup": false,
"invoicing": true,
"key_auth": false,
"language": "en-au",
"last_name": "Doe",
"mailing_list": true,
"meta": {},
"my_notes": "2014-06-05 08:15:39.864947",
"nickname": "",
"phone": "",
"postcode": "1000",
"reseller": "",
"signup_time": "2013-05-28T11:57:01.090639+00:00",
"state": "REGULAR",
"tax_name": null,
"tax_rate": null,
"title": "Mr",
"town": "Sofia",
"uuid": "6f670b3c-a2e6-433f-aeab-b976b1cdaf03",
"vat": "123"
}
Schema¶
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{
"allowed_detail_http_methods": [
"get",
"put"
],
"allowed_list_http_methods": [
"get",
"put"
],
"default_format": "application/json",
"default_limit": 20,
"fields": {
"address": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"api_https_only": {
"blank": false,
"default": false,
"help_text": "Boolean data. Ex: True",
"nullable": false,
"readonly": false,
"type": "boolean",
"unique": false
},
"autotopup_amount": {
"blank": false,
"default": 0,
"help_text": "Fixed precision numeric data. Ex: 26.73",
"nullable": false,
"readonly": false,
"type": "decimal",
"unique": false
},
"autotopup_threshold": {
"blank": false,
"default": 0,
"help_text": "Fixed precision numeric data. Ex: 26.73",
"nullable": false,
"readonly": false,
"type": "decimal",
"unique": false
},
"bank_reference": {
"blank": true,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": true,
"readonly": true,
"type": "string",
"unique": false
},
"clone_naming": {
"blank": false,
"default": "NONE",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"company": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"country": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"currency": {
"blank": true,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": true,
"readonly": true,
"type": "string",
"unique": false
},
"email": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": true,
"type": "string",
"unique": false
},
"first_name": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"has_autotopup": {
"blank": false,
"default": false,
"help_text": "Boolean data. Ex: True",
"nullable": false,
"readonly": false,
"type": "boolean",
"unique": false
},
"invoicing": {
"blank": false,
"default": true,
"help_text": "Boolean data. Ex: True",
"nullable": false,
"readonly": false,
"type": "boolean",
"unique": false
},
"key_auth": {
"blank": false,
"default": false,
"help_text": "Boolean data. Ex: True",
"nullable": false,
"readonly": false,
"type": "boolean",
"unique": false
},
"language": {
"blank": false,
"default": "EN",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"last_name": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"mailing_list": {
"blank": false,
"default": true,
"help_text": "Boolean data. Ex: True",
"nullable": false,
"readonly": false,
"type": "boolean",
"unique": false
},
"meta": {
"blank": false,
"default": "No default provided.",
"help_text": "A dictionary of data. Ex: {'price': 26.73, 'name': 'Daniel'}",
"nullable": false,
"readonly": false,
"type": "dict",
"unique": false
},
"my_notes": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": true,
"readonly": false,
"type": "string",
"unique": false
},
"nickname": {
"blank": false,
"default": "",
"help_text": "User nickname",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"phone": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"postcode": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": true,
"readonly": false,
"type": "string",
"unique": false
},
"reseller": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"signup_time": {
"blank": false,
"default": "2014-06-05T09:47:34.474924+00:00",
"help_text": "A date & time as a string. Ex: \"2010-11-10T03:07:43\"",
"nullable": false,
"readonly": false,
"type": "datetime",
"unique": false
},
"state": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": true,
"type": "string",
"unique": false
},
"tax_name": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": true,
"readonly": true,
"type": "string",
"unique": false
},
"tax_rate": {
"blank": false,
"default": "No default provided.",
"help_text": "Fixed precision numeric data. Ex: 26.73",
"nullable": true,
"readonly": true,
"type": "decimal",
"unique": false
},
"title": {
"blank": false,
"default": "",
"help_text": "User title",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"town": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
},
"uuid": {
"blank": false,
"default": "No default provided.",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": true,
"type": "string",
"unique": false
},
"vat": {
"blank": false,
"default": "",
"help_text": "Unicode string data. Ex: \"Hello World\"",
"nullable": false,
"readonly": false,
"type": "string",
"unique": false
}
}
}