There was a problem loading the comments.

Account

Support Portal  »  Knowledgebase  »  Viewing Article

  Print

General

Account managing is done via ReST endpoint, allowing us to make most of the needed account related actions - create, update, delete ... etc.

  • create account - by creating account we may do 2 things - create account with username, and create account with valid email address. Important - when creating account with valid username, its critical to assure that the domain is already present into Communigate system - otherwise an err will be returned.

Example:

POST: {{host}}/cmailpro/account
HEADERS:
Accept:application/hal+json
Content-Type:application/json
Authorization:Bearer {{current_access_token}}

body:

{
    "name": "ruse1@ruse_office1.apihawk.com",
    "type": "TextMailbox",
    "real_name": "Ivan Ivanov",
    "password": "12qwerty34"
}

response:

{
    "account": {
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "RealName": "Ivan Ivanov"
    },
    "settings": {
        "AccessModes": "All",
        "AddMailTrailer": "YES",
        "AddWebBanner": "YES",
        "AirSyncAllowed": "*",
        "AirSyncSessionLimit": "10",
        "ArchiveMessagesAfter": "0",
        "BannerInfo": "",
        "CallInpFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallLogs": "YES",
        "CallOutFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallsLimit": "-1",
        "DefaultMailboxType": "TextMailbox",
        "DefaultWebPage": "default.html",
        "DeleteMessagesAfter": "0",
        "DialogInfo": "YES",
        "EraseDeletedMessages": "NO",
        "ExternalINBOX": "NO",
        "FailedLoginFlow": {
            "subValue": [
                "10",
                "1m"
            ]
        },
        "HiddenProntoModules": "",
        "HiddenSkins": "",
        "IMAPSeesNonMail": "NO",
        "IMAPSessionLimit": "20",
        "IMLogs": "YES",
        "LogLogin": "NO",
        "LogProtocols": "NO",
        "MailInpFlow": {
            "subValue": [
                "20",
                "1s"
            ]
        },
        "MailOutFlow": {
            "subValue": [
                "100",
                "60"
            ]
        },
        "MailToAll": "YES",
        "MaxAccountSize": "unlimited",
        "MaxFileSize": "unlimited",
        "MaxMailboxes": "-1",
        "MaxMailOutSize": "-1",
        "MaxMessageSize": "-1",
        "MaxRosterItems": "20",
        "MaxSignalContacts": "10",
        "MaxWebFiles": "1000",
        "MaxWebSize": "100M",
        "NotifyOutFlow": {
            "subValue": [
                "100",
                "15"
            ]
        },
        "OSUserName": "*",
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "PasswordComplexity": "",
        "PasswordEncryption": "A-crpt",
        "PasswordMinLength": "6",
        "PasswordRecovery": "YES",
        "POPSessionFlow": {
            "subValue": [
                "5",
                "5m"
            ]
        },
        "POPSessionLimit": "5",
        "PSTNAreaCode": "",
        "PSTNEmergency": "",
        "PSTNFromName": "7459843785",
        "PSTNGatewayAuthName": "7459843785",
        "PSTNGatewayDomain": "194.153.118.34",
        "PSTNGatewayPassword": "98747634839",
        "PSTNGatewayVia": "194.153.118.34",
        "PWDAllowed": "YES",
        "QuotaAlert": "80",
        "QuotaNotice": "90",
        "QuotaSuspend": "100",
        "RealName": "Ivan Ivanov",
        "RequireAPOP": "NO",
        "RPOPAllowed": "NO",
        "RSIPAllowed": "NO",
        "RulesAllowed": "Filter Only",
        "ServiceClass": "basic",
        "serviceClassDescription": {
            "subKey": {
                "Premium": {
                    "subKey": {
                        "currency": "BGN",
                        "description": {
                            "binString": {
                                "base64": [
                                    "U3VzcGVuZGlzc2UgdnVscHV0YXRlIGVsaXQgZXN0LCBub24gcHVsdmluYXIgbnVsbGEgcHVsdmluYXIgYS4gQ3JhcyBtZXR1cyBsZWN0dXMsIHRlbXB1cyBxdWlzIHJpc3VzIGV1LCB0aW5jaWR1bnQgdWx0cmljaWVzIHB1cnVzLiBEb25lYyBlZ2V0IHVybmEgZWdldCBkdWkgdml2ZXJyYSBhY2N1bXNhbiB2ZWwgZXUgbmlzaS4gTWFlY2VuYXMgbmliaCBhbnRlLCBjb25zZXF1YXQgbW9sbGlzIG1ldHVzIHZpdGFlOyB0cmlzdGlxdWUgbHVjdHVzIG51bGxhLiBGdXNjZSBhYyBzZW0gYXVndWUuIE5hbSBjb21tb2RvLCB0ZWxsdXMgdmVsIGVsZWlmZW5kIGZyaW5naWxsYSwgbmlzaSB0dXJwaXMgbWFsZXN1YWRhIG51bGxhLCB2ZWhpY3VsYSB2ZW5lbmF0aXMgdGVsbHVzIGxhY3VzIHNlZCBvcmNpLiBTZWQgc2VtcGVyIG5vbiBwdXJ1cyBpbiBwb3J0dGl0b3IuIER1aXMgc2l0IGFtZXQgb3JjaSBkb2xvci4gRG9uZWMgdGVtcHVzIG1hc3NhIG51bmMuDQo="
                                ]
                            }
                        },
                        "price": "5"
                    }
                }
            }
        },
        "ServiceClasses": {
            "subKey": {
                "Bobby": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "XMPP",
                                "XIMSS"
                            ]
                        }
                    }
                },
                "NotJabberOnly": {
                    "subKey": {
                        "AccessModes": "All"
                    }
                },
                "Premium": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Signal",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "AirSync",
                                "XMPP",
                                "WebMail",
                                "XIMSS",
                                "FTP",
                                "ACAP",
                                "PWD",
                                "LDAP",
                                "S/MIME",
                                "WebCAL",
                                "WebSite",
                                "HTTP"
                            ]
                        }
                    }
                },
                "Standard": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "WebMail",
                                "XIMSS",
                                "ACAP",
                                "RADIUS",
                                "S/MIME",
                                "HTTP"
                            ]
                        }
                    }
                }
            }
        },
        "SignalRulesAllowed": "Any",
        "SIPIMMode": "YES",
        "SyncMode": "NO",
        "SyncServer": "",
        "SyncUserName": "^0",
        "SyncUserPassword": "^0",
        "UseAppPassword": "YES",
        "UseCertificateAuth": "NO",
        "UseExtPassword": "NO",
        "UseKerberosPassword": "YES",
        "UseSysPassword": "NO",
        "WebUserSessionLimit": "10",
        "XIMSSSessionLimit": "10",
        "XMPPSessionLimit": "10"
    },
    "_links": {
        "self": {
            "href": "http://apihawk_hostpulse.localhost/cmailpro/account"
        }
    }
}

Update account - fields are - name, type, password, settings

Example - change account type:

PATCH: {{host}}/cmailpro/account/ruse1@ruse_office.apihawk.com

HEADERS:
Accept:application/hal+json
Content-Type:application/json
Authorization:Bearer {{current_access_token}}

body:

{
    "type": "MultiMailbox"
}

response:

{
    "account": {
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "RealName": "Ivan Ivanov"
    },
    "settings": {
        "AccessModes": "All",
        "AddMailTrailer": "YES",
        "AddWebBanner": "YES",
        "AirSyncAllowed": "*",
        "AirSyncSessionLimit": "10",
        "ArchiveMessagesAfter": "0",
        "BannerInfo": "",
        "CallInpFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallLogs": "YES",
        "CallOutFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallsLimit": "-1",
        "DefaultMailboxType": "TextMailbox",
        "DefaultWebPage": "default.html",
        "DeleteMessagesAfter": "0",
        "DialogInfo": "YES",
        "EraseDeletedMessages": "NO",
        "ExternalINBOX": "NO",
        "FailedLoginFlow": {
            "subValue": [
                "10",
                "1m"
            ]
        },
        "HiddenProntoModules": "",
        "HiddenSkins": "",
        "IMAPSeesNonMail": "NO",
        "IMAPSessionLimit": "20",
        "IMLogs": "YES",
        "LogLogin": "NO",
        "LogProtocols": "NO",
        "MailInpFlow": {
            "subValue": [
                "20",
                "1s"
            ]
        },
        "MailOutFlow": {
            "subValue": [
                "100",
                "60"
            ]
        },
        "MailToAll": "YES",
        "MaxAccountSize": "unlimited",
        "MaxFileSize": "unlimited",
        "MaxMailboxes": "-1",
        "MaxMailOutSize": "-1",
        "MaxMessageSize": "-1",
        "MaxRosterItems": "20",
        "MaxSignalContacts": "10",
        "MaxWebFiles": "1000",
        "MaxWebSize": "100M",
        "NotifyOutFlow": {
            "subValue": [
                "100",
                "15"
            ]
        },
        "OSUserName": "*",
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "PasswordComplexity": "",
        "PasswordEncryption": "A-crpt",
        "PasswordMinLength": "6",
        "PasswordRecovery": "YES",
        "POPSessionFlow": {
            "subValue": [
                "5",
                "5m"
            ]
        },
        "POPSessionLimit": "5",
        "PSTNAreaCode": "",
        "PSTNEmergency": "",
        "PSTNFromName": "7459843785",
        "PSTNGatewayAuthName": "7459843785",
        "PSTNGatewayDomain": "194.153.118.34",
        "PSTNGatewayPassword": "98747634839",
        "PSTNGatewayVia": "194.153.118.34",
        "PWDAllowed": "YES",
        "QuotaAlert": "80",
        "QuotaNotice": "90",
        "QuotaSuspend": "100",
        "RealName": "Ivan Ivanov",
        "RequireAPOP": "NO",
        "RPOPAllowed": "NO",
        "RSIPAllowed": "NO",
        "RulesAllowed": "Filter Only",
        "ServiceClass": "basic",
        "serviceClassDescription": {
            "subKey": {
                "Premium": {
                    "subKey": {
                        "currency": "BGN",
                        "description": {
                            "binString": {
                                "base64": [
                                    "U3VzcGVuZGlzc2UgdnVscHV0YXRlIGVsaXQgZXN0LCBub24gcHVsdmluYXIgbnVsbGEgcHVsdmluYXIgYS4gQ3JhcyBtZXR1cyBsZWN0dXMsIHRlbXB1cyBxdWlzIHJpc3VzIGV1LCB0aW5jaWR1bnQgdWx0cmljaWVzIHB1cnVzLiBEb25lYyBlZ2V0IHVybmEgZWdldCBkdWkgdml2ZXJyYSBhY2N1bXNhbiB2ZWwgZXUgbmlzaS4gTWFlY2VuYXMgbmliaCBhbnRlLCBjb25zZXF1YXQgbW9sbGlzIG1ldHVzIHZpdGFlOyB0cmlzdGlxdWUgbHVjdHVzIG51bGxhLiBGdXNjZSBhYyBzZW0gYXVndWUuIE5hbSBjb21tb2RvLCB0ZWxsdXMgdmVsIGVsZWlmZW5kIGZyaW5naWxsYSwgbmlzaSB0dXJwaXMgbWFsZXN1YWRhIG51bGxhLCB2ZWhpY3VsYSB2ZW5lbmF0aXMgdGVsbHVzIGxhY3VzIHNlZCBvcmNpLiBTZWQgc2VtcGVyIG5vbiBwdXJ1cyBpbiBwb3J0dGl0b3IuIER1aXMgc2l0IGFtZXQgb3JjaSBkb2xvci4gRG9uZWMgdGVtcHVzIG1hc3NhIG51bmMuDQo="
                                ]
                            }
                        },
                        "price": "5"
                    }
                }
            }
        },
        "ServiceClasses": {
            "subKey": {
                "Bobby": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "XMPP",
                                "XIMSS"
                            ]
                        }
                    }
                },
                "NotJabberOnly": {
                    "subKey": {
                        "AccessModes": "All"
                    }
                },
                "Premium": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Signal",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "AirSync",
                                "XMPP",
                                "WebMail",
                                "XIMSS",
                                "FTP",
                                "ACAP",
                                "PWD",
                                "LDAP",
                                "S/MIME",
                                "WebCAL",
                                "WebSite",
                                "HTTP"
                            ]
                        }
                    }
                },
                "Standard": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "WebMail",
                                "XIMSS",
                                "ACAP",
                                "RADIUS",
                                "S/MIME",
                                "HTTP"
                            ]
                        }
                    }
                }
            }
        },
        "SignalRulesAllowed": "Any",
        "SIPIMMode": "YES",
        "SyncMode": "NO",
        "SyncServer": "",
        "SyncUserName": "^0",
        "SyncUserPassword": "^0",
        "UseAppPassword": "YES",
        "UseCertificateAuth": "NO",
        "UseExtPassword": "NO",
        "UseKerberosPassword": "YES",
        "UseSysPassword": "NO",
        "WebUserSessionLimit": "10",
        "XIMSSSessionLimit": "10",
        "XMPPSessionLimit": "10"
    },
    "_account_info": {
        "Created": "08-01-2018_13:41:20",
        "MailboxSeq": {
            "number": [
                "1515418"
            ]
        },
        "StorageUsed": "0"
    },
    "_links": {
        "self": {
            "href": "http://apihawk_hostpulse.localhost/cmailpro/account/ruse1"
        }
    }
}

Get All Mail Accounts for defined domain

{{host}}/cmailpro/account?domain=ruse_office1.apihawk.com

HEADERS:
Accept:application/hal+json
Content-Type:application/json
Authorization:Bearer {{current_access_token}}

response:

{
    "_links": {
        "self": {
            "href": "http://apihawk_hostpulse.localhost/cmailpro/account?domain=ruse_office1.apihawk.com"
        }
    },
    "_embedded": {
        "user": [
            {
                "ruse1": "macnt",
                "test": "macnt"
            }
        ]
    },
    "total_items": 1
}

Get sepcific/defined account entity - fetches the account, its basic settings, and its effective ones, for the defined account.

GET: {{host}}/cmailpro/account/ruse1@ruse_office.apihawk.com

HEADERS:
Accept:application/hal+json
Content-Type:application/json
Authorization:Bearer {{current_access_token}}

response:

{
    "account": {
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "RealName": "Ivan Ivanov"
    },
    "settings": {
        "AccessModes": "All",
        "AddMailTrailer": "YES",
        "AddWebBanner": "YES",
        "AirSyncAllowed": "*",
        "AirSyncSessionLimit": "10",
        "ArchiveMessagesAfter": "0",
        "BannerInfo": "",
        "CallInpFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallLogs": "YES",
        "CallOutFlow": {
            "subValue": [
                "-1",
                "3600"
            ]
        },
        "CallsLimit": "-1",
        "DefaultMailboxType": "TextMailbox",
        "DefaultWebPage": "default.html",
        "DeleteMessagesAfter": "0",
        "DialogInfo": "YES",
        "EraseDeletedMessages": "NO",
        "ExternalINBOX": "NO",
        "FailedLoginFlow": {
            "subValue": [
                "10",
                "1m"
            ]
        },
        "HiddenProntoModules": "",
        "HiddenSkins": "",
        "IMAPSeesNonMail": "NO",
        "IMAPSessionLimit": "20",
        "IMLogs": "YES",
        "LogLogin": "NO",
        "LogProtocols": "NO",
        "MailInpFlow": {
            "subValue": [
                "20",
                "1s"
            ]
        },
        "MailOutFlow": {
            "subValue": [
                "100",
                "60"
            ]
        },
        "MailToAll": "YES",
        "MaxAccountSize": "unlimited",
        "MaxFileSize": "unlimited",
        "MaxMailboxes": "-1",
        "MaxMailOutSize": "-1",
        "MaxMessageSize": "-1",
        "MaxRosterItems": "20",
        "MaxSignalContacts": "10",
        "MaxWebFiles": "1000",
        "MaxWebSize": "100M",
        "NotifyOutFlow": {
            "subValue": [
                "100",
                "15"
            ]
        },
        "OSUserName": "*",
        "Password": {
            "binString": {
                "base64": [
                    "ASQ1Z3N1ZHNpOS4="
                ]
            }
        },
        "PasswordComplexity": "",
        "PasswordEncryption": "A-crpt",
        "PasswordMinLength": "6",
        "PasswordRecovery": "YES",
        "POPSessionFlow": {
            "subValue": [
                "5",
                "5m"
            ]
        },
        "POPSessionLimit": "5",
        "PSTNAreaCode": "",
        "PSTNEmergency": "",
        "PSTNFromName": "7459843785",
        "PSTNGatewayAuthName": "7459843785",
        "PSTNGatewayDomain": "194.153.118.34",
        "PSTNGatewayPassword": "98747634839",
        "PSTNGatewayVia": "194.153.118.34",
        "PWDAllowed": "YES",
        "QuotaAlert": "80",
        "QuotaNotice": "90",
        "QuotaSuspend": "100",
        "RealName": "Ivan Ivanov",
        "RequireAPOP": "NO",
        "RPOPAllowed": "NO",
        "RSIPAllowed": "NO",
        "RulesAllowed": "Filter Only",
        "ServiceClass": "basic",
        "serviceClassDescription": {
            "subKey": {
                "Premium": {
                    "subKey": {
                        "currency": "BGN",
                        "description": {
                            "binString": {
                                "base64": [
                                    "U3VzcGVuZGlzc2UgdnVscHV0YXRlIGVsaXQgZXN0LCBub24gcHVsdmluYXIgbnVsbGEgcHVsdmluYXIgYS4gQ3JhcyBtZXR1cyBsZWN0dXMsIHRlbXB1cyBxdWlzIHJpc3VzIGV1LCB0aW5jaWR1bnQgdWx0cmljaWVzIHB1cnVzLiBEb25lYyBlZ2V0IHVybmEgZWdldCBkdWkgdml2ZXJyYSBhY2N1bXNhbiB2ZWwgZXUgbmlzaS4gTWFlY2VuYXMgbmliaCBhbnRlLCBjb25zZXF1YXQgbW9sbGlzIG1ldHVzIHZpdGFlOyB0cmlzdGlxdWUgbHVjdHVzIG51bGxhLiBGdXNjZSBhYyBzZW0gYXVndWUuIE5hbSBjb21tb2RvLCB0ZWxsdXMgdmVsIGVsZWlmZW5kIGZyaW5naWxsYSwgbmlzaSB0dXJwaXMgbWFsZXN1YWRhIG51bGxhLCB2ZWhpY3VsYSB2ZW5lbmF0aXMgdGVsbHVzIGxhY3VzIHNlZCBvcmNpLiBTZWQgc2VtcGVyIG5vbiBwdXJ1cyBpbiBwb3J0dGl0b3IuIER1aXMgc2l0IGFtZXQgb3JjaSBkb2xvci4gRG9uZWMgdGVtcHVzIG1hc3NhIG51bmMuDQo="
                                ]
                            }
                        },
                        "price": "5"
                    }
                }
            }
        },
        "ServiceClasses": {
            "subKey": {
                "Bobby": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "XMPP",
                                "XIMSS"
                            ]
                        }
                    }
                },
                "NotJabberOnly": {
                    "subKey": {
                        "AccessModes": "All"
                    }
                },
                "Premium": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Signal",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "MAPI",
                                "AirSync",
                                "XMPP",
                                "WebMail",
                                "XIMSS",
                                "FTP",
                                "ACAP",
                                "PWD",
                                "LDAP",
                                "S/MIME",
                                "WebCAL",
                                "WebSite",
                                "HTTP"
                            ]
                        }
                    }
                },
                "Standard": {
                    "subKey": {
                        "AccessModes": {
                            "subValue": [
                                "27",
                                "Mail",
                                "Relay",
                                "Mobile",
                                "TLS",
                                "POP",
                                "IMAP",
                                "WebMail",
                                "XIMSS",
                                "ACAP",
                                "RADIUS",
                                "S/MIME",
                                "HTTP"
                            ]
                        }
                    }
                }
            }
        },
        "SignalRulesAllowed": "Any",
        "SIPIMMode": "YES",
        "SyncMode": "NO",
        "SyncServer": "",
        "SyncUserName": "^0",
        "SyncUserPassword": "^0",
        "UseAppPassword": "YES",
        "UseCertificateAuth": "NO",
        "UseExtPassword": "NO",
        "UseKerberosPassword": "YES",
        "UseSysPassword": "NO",
        "WebUserSessionLimit": "10",
        "XIMSSSessionLimit": "10",
        "XMPPSessionLimit": "10"
    },
    "_account_info": {
        "Created": "08-01-2018_13:41:20",
        "MailboxSeq": {
            "number": [
                "1515418"
            ]
        },
        "StorageUsed": "0"
    },
    "_links": {
        "self": {
            "href": "http://apihawk_hostpulse.localhost/cmailpro/account/ruse1"
        }
    }
}

Delete account - deletes the account by defining the account name

Example:

DELETE: {{host}}/cmailpro/account/ruse1@ruse_office.apihawk.com
HEADERS:

response: 204 No content

If we try to delete non existent/already deleted/ account, we receive 422 Unprocessable Entity:

{
    "type": "http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html",
    "title": "Unprocessable Entity",
    "status": 422,
    "detail": "unknown user account"
}

Fields explanations

  • "EraseDeletedMessages": "YES" - delete messages after X time
  • "ServiceClass": "Standard" - type of account service , basic, Premium, Standard ...
  • "RecoverPassword": "misho_test@google.com" - password recovery email

Examples

Change settings, without changing name, pass etc:

{
    "settings": {
    	"EraseDeletedMessages": "YES"
    }
}
{
    "settings": {
    	"ServiceClass": "Standard"
    }
}
{
    "settings": {
    	"RecoverPassword": "misho_test@google.com"
    }
}

Or bulk one, eg chnage several settings in one call:

{
    "settings": {
    	"EraseDeletedMessages": "YES",
    	"ServiceClass": "Standard",
    	"RecoverPassword": "misho_test@google.com"
    }
}

Share via

Related Articles

© ApiHawk