Returns the accounts that meet the given conditions.
Admin SDKAdmin.api('site.accounts.find', request, function(response) { … });
HTTP POST/api/v10/site.accounts.find
{
"conditions" : { // returns only the accounts …
"after" : 29 // … with identifier after this - int(0…)
},
"fields" : [ "id", "name", … ], // fields to return - string
"order" : [ "name" ], // sort order of returned accounts, can contain "id", "-id", "name", "-"name", "email", "-email",
// "access", "-access", "days", "-days", "fromHour", "-fromHour", "toHour", "-toHour", "ip" and "-ip" - string
"limit" : 10, // maximum number of accounts to return - int(1…)
"first" : 30 // index of the first account to return - int(0…)
}
{
"status" : "ok",
"accounts" : [ {
"id" : 29, // identifier - int(1…)
"name" : "John Smith", // name - string(1…50)
"email" : "johnsmith@acme.com", // email address - string(3…120)
"access" : "Limited", // access, can be "Full", "Limited" or "Denied" - string
"days" : "MondayToFriday", // days, can be "MondayToSunday", "MondayToSaturday" or "MondayToFriday" - string
"fromHour" : 7, // from hour - int(0…23)
"toHour" : 18, // from hour - int(1…24)
"sections" : [ "Catalog", "Sales", … ], // sections, can be "Catalog", "Inventory", "Marketing", "Sales", "Customers", "Website", "Apps" and "Settings" - string
"ip" : "135.22.83.12", // IP number (can be null) - string(7…15)
"locale" : "en-GB", // locale for the admin panel - string(5)
"gravatarHash" : "…", // gravatar hash - string(32)
"background" : "green.png", // background file name (can be null) - string(5…36)
"rowsNumber" : 15 // rows number - int(5…100)
}, … ]
}
Returns an account given its identifier.
Admin SDKAdmin.api('site.accounts.get', request, function(response) { … });
HTTP POST/api/v10/site.accounts.get
{
"id" : 29, // identifier of the account (required) - int(1…)
"fields" : [ "id", "name", … ] // fields to return - string
}
{
"status" : "ok",
"account" : { // (can be null)
"id" : 29, // identifier - int(1…)
"name" : "John Smith", // name - string(1…50)
"email" : "johnsmith@acme.com", // email address - string(3…120)
"access" : "Limited", // access, can be "Full", "Limited" or "Denied" - string
"days" : "MondayToFriday", // days, can be "MondayToSunday", "MondayToSaturday" or "MondayToFriday" - string
"fromHour" : 7, // from hour - int(0…23)
"toHour" : 18, // from hour - int(1…24)
"sections" : [ "Catalog", "Sales", … ], // sections, can be "Catalog", "Inventory", "Marketing", "Sales", "Customers", "Website", "Apps" and "Settings" - string
"ip" : "135.22.83.12", // IP number (can be null) - string(7…15)
"locale" : "en-GB", // locale for the admin panel - string(5)
"gravatarHash" : "…", // gravatar hash - string(32)
"background" : "green.png", // background file name (can be null) - string(5…36)
"rowsNumber" : 15 // rows number - int(5…100)
}
}
Authenticates an account given its email and password and on success returns it.
Admin SDKAdmin.api('site.accounts.authenticate', request, function(response) { … });
HTTP POST/api/v10/site.accounts.authenticate
{
"email" : "johnsmith@acme.com", // email (required) - string(3…120)
"password" : "y3Mp7Haz8U", // password (required) - string(5…20)
"fields" : [ "id", "name", … ] // fields to return - string
}
{
"status" : "ok",
"account" : [ { // (can be null)
"id" : 29, // identifier - int(1…)
"name" : "John Smith", // name - string(1…50)
"email" : "johnsmith@acme.com", // email address - string(3…120)
"access" : "Limited", // access, can be "Full", "Limited" or "Denied" - string
"days" : "MondayToFriday", // days, can be "MondayToSunday", "MondayToSaturday" or "MondayToFriday" - string
"fromHour" : 7, // from hour - int(0…23)
"toHour" : 18, // from hour - int(1…24)
"sections" : [ "Catalog", "Sales", … ], // sections, can be "Catalog", "Inventory", "Marketing", "Sales", "Customers", "Website", "Apps" and "Settings" - string
"ip" : "135.22.83.12", // IP number (can be null) - string(7…15)
"locale" : "en-GB", // locale for the admin panel - string(5)
"gravatarHash" : "…", // gravatar hash - string(32)
"background" : "green.png", // background file name (can be null) - string(5…36)
"rowsNumber" : 15 // rows number - int(5…100)
}, … ]
}
Total number of accounts.
Admin SDKAdmin.api('site.accounts.count', null, function(response) { … });
HTTP POST/api/v10/site.accounts.count
{
"status" : "ok",
"count" : 23 // number of accounts - int(0…)
}
Creates a new account.
Admin SDKAdmin.api('site.accounts.create', request, function(response) { … });
HTTP POST/api/v10/site.accounts.create
{
"account" : { // account to create (required)
"name" : "John Smith", // Name (required) - string(1…50)
"email" : "johnsmith@acme.com", // email address (required) - string(3…120)
"password" : "G7icE%yQ", // password - string(5…20)
"access" : "Limited", // access, can be "Full", "Limited" or "Denied" - string
"days" : "MondayToFriday", // days, can be "MondayToSunday", "MondayToSaturday" or "MondayToFriday" - string
"fromHour" : 7, // from hour - int(0…23)
"toHour" : 18, // from hour - int(1…24)
"sections" : [ "Catalog", "Sales", null ], // sections, can be "Catalog", "Inventory", "Marketing", "Sales", "Customers", "Website", "Apps" and "Settings" - string
"ip" : "135.22.83.12", // IP number (can be null) - string(7…15)
"locale" : "en-GB", // locale for the admin panel - string(2…5)
"gravatarHash" : "…", // gravatar hash - string(32)
"background" : "green.png", // Background file name (can be null) - string(5…36)
"rowsNumber" : 15 // Rows number - int(5…100)
}
}
{
"status" : "ok",
"id" : 29 // identifier of the new account - int(1…)
}
Field | Type | Description |
---|---|---|
account | LimitReached | Maximum number of limited accounts has been reached |
background | Malformed | Background is not a well formed file name |
AlreadyExists | Account with email '<email> ' already exixts |
|
Malformed | '<email> ' is not a well formed email address |
|
ip | Malformed | '<ip> ' is not a well formed IP address |
locale | Malformed | '<locale> ' is not a valid locale code |
Updates an account. Any fields left out of the request will remain unchanged.
Admin SDKAdmin.api('site.accounts.update', request, function(response) { … });
HTTP POST/api/v10/site.accounts.update
{
"id" : 12, // identifier of the account to update (required) - int(1…)
"account" : { // account's fields to update (required)
"name" : "John Smith", // Name - string(1…50)
"email" : "johnsmith@acme.com", // email address - string(3…120)
"access" : "Limited", // access, can be "Full", "Limited" or "Denied" - string
"days" : "MondayToFriday", // days, can be "MondayToSunday", "MondayToSaturday" or "MondayToFriday" - string
"fromHour" : 7, // from hour - int(0…23)
"toHour" : 18, // from hour - int(1…24)
"sections" : [ "Catalog", "Sales", null ], // sections, can be "Catalog", "Inventory", "Marketing", "Sales", "Customers", "Website", "Apps" and "Settings" - string
"ip" : "135.22.83.12", // IP number (can be null) - string(7…15)
"locale" : "en-GB", // locale for the admin panel - string(2…5)
"background" : "green.png", // Background file name (can be null) - string(5…36)
"rowsNumber" : 15 // Rows number - int(5…100)
}
}
{
"status" : "ok"
}
Field | Type | Description |
---|---|---|
access | InvalidValue | Access 'Limited' is not allowed |
id | NotFound | Account <id> does not exist |
background | Malformed | Background is not a well formed file name |
AlreadyExists | Account with email '<email> ' already exixts |
|
Malformed | '<email> ' is not a well formed email address |
|
ip | Malformed | '<ip> ' is not a well formed IP address |
locale | Malformed | '<locale> ' is not a valid locale code |
Deletes one o more accounts.
Admin SDKAdmin.api('site.accounts.delete', request, function(response) { … });
HTTP POST/api/v10/site.accounts.delete
{
"ids" : [ 29, 12, … ] // identifiers of the accounts to delete (required) - int(1…)
}
{
"status" : "ok"
}