From RPM Wiki
| Table of contents |
[edit]
Summary
API: Get information for one user
[edit]
Request
A username is always required
{
"Key":"{api key}",
"Username":"{username}"
}
In addition, you can check a password
{
"Key":"{api key}",
"Username":"{username}",
"Password":"{password}"
}
[edit]
Examples
http://demo.rpmsoftware.com/rpm/Api.svc/User
{
"Key":"abc123def456",
"Username":"jsmith"
}
{
"Key":"abc123def456",
"Username":"jsmith",
"Password":"123abc"
}
[edit]
Response
The response depends on the user type. Admin users are ignored (returns user not found).
- If a password is also sent then a confirmation is returned if the password is correct or not, otherwise it is left out of the result. Also, if the user is locked then the password check is left out of the result.
- Returns "Logon" of true (enabled) or false (disabled)
[edit]
Staff user
{"UserResult":
{
"Username":"{username}",
"Logon":{true/false},
"Locked":{true/false},
"PasswordCheck":{true/false},
"LastLogon":{
"When":"{date and time}",
"Browser":"{browser}",
"IP":"{IP address}"
},
"StaffID":"{staff id}",
"Role":"{role name}",
"RoleID":"{role id}",
"Added":"{added date}",
"Modified":"{modified date}",
"PrimaryContact": {
"Salutation": "{salutation}",
"FirstName": "{first name}",
"LastName": "{last name}",
"Title": "{title}",
"Email": "{email}",
"Phone": {
"{phone type}": "{phone number}",
{repeat as needed}
}
},
"Fields": [
{
"Field": "{field name}",
"Value": "{field value"
},
{repeat as needed}
]
}
}
[edit]
Agent user
{"UserResult":
{
"Username":"{username}",
"Logon":{true/false},
"Locked":{true/false},
"PasswordCheck":{true/false},
"LastLogon":{
"When":"{date and time}",
"Browser":"{browser}",
"IP":"{IP address}"
},
"Rep":"{rep name}",
"RepID":"{rep id}",
"Agency":"{agency name}",
"AgencyID":"{agency id}",
"Type": "{Manager/Rep/Both}"
"Relationship":"{Employee/Sub-agent}",
"Added":"{added date}",
"Modified":"{modified date}",
"PrimaryContact": {
"Salutation": "{salutation}",
"FirstName": "{first name}",
"LastName": "{last name}",
"Title": "{title}",
"Email": "{email}",
"Phone": {
"{phone type}": "{phone number}",
{repeat as needed}
}
},
"Fields": [
{
"Field": "{field name}",
"Value": "{field value"
},
{repeat as needed}
],
"AssignmentCodes": [
{
"Supplier": "{supplier name}",
"SupplierID": "{supplier ID}",
"AssignmentCode": "{assignment code}"
},
{repeat as needed}
],
"NotesForStaff": [
{
"Note": "{note text}",
"Added": "{added date}",
"By": "{user name}"
},
{repeat as needed}
]
}
}
- Notes are in order of oldest to newest
[edit]
Example
{"UserResult":
{
"Username":"bbradley",
"Logon":true,
"Locked":false,
"PasswordCheck":true,
"LastLogon":{
"When":"10/19/2009 1:55:02 PM",
"Browser":"IE8",
"IP":"127.0.0.1"
},
"Rep":"Brian Bradley",
"RepID":"1069",
"Agency": "Ahead Networks",
"AgencyID": "446",
"Type": "Both",
"Relationship": "Employee",
"Added": "1/20/2007",
"Modified": "2/2/2009",
"PrimaryContact": {
"Salutation": "Mr",
"FirstName": "Brian",
"LastName": "Bradley",
"Title": "",
"Email": "bb@ahead.net",
"Phone": {
"Business": "1-800-555-1234",
"Fax": "1-800-555-1235"
}
},
"Fields": [
{
"Field": "My custom list",
"Value": "Some option"
},
{
"Field": "Extra date",
"Value": "4/16/2008"
}
],
"AssignmentCodes": [
{
"AssignmentCode": "ABC012345",
"Supplier": "AT&D",
"SupplierID":"13"
},
{
"AssignmentCode": "ABC033333",
"Supplier": "AT&D",
"SupplierID":"13"
}
],
"NotesForStaff": [
{
"Note": "This is a test note",
"Added": "1/1/2009",
"By": "John Smith"
},
{
"Note": "This is another test note",
"Added": "2/2/2009",
"By": "John Smith"
}
]
}
}
[edit]
Errors
- "User not found"
- After 100 incorrect password attempts, additional attempts that day will return "Daily incorrect password limit reached". Any implementation of this API that is allowing users to enter a password should have its own incorrect limit that is far lower. That lower limit should be per username and IP address.
- A subscription that gets an unreasonable amount of password rejections by API will be flagged by RPM and have the API disabled.
[edit]
History
- Bulletproof Tiger: Feature added
- This page was last modified 19:37, 13 Jan 2010.
- This page has been accessed 989 times.
