Skip to content
Accounts and sub-accounts

Accounts and sub-accounts

By Loïc Bresler 6 min read

These methods return your account details and let a main account (reseller, white label) manage its sub-accounts.

They are all called with POST, with a JSON body that contains your api_key. Parameter tables do not repeat it. See the common rules.

Account details

Access point: https://www.mdworks.fr/api_http/account_info

This method returns the details of the account the key belongs to. It is the right first call to check an access: it also returns the caller’s IP as the server sees it, which helps diagnose an Error auth ip error.

Parameters: none apart from api_key.

Example of posted data:

{"api_key": "YOUR_API_KEY"}

Response:

{
  "user_id": 1234,
  "login": "myaccount",
  "name": "Example Company",
  "email": "contact@example.com",
  "credits": 25000,
  "ip": "54.75.157.176"
}
FieldDescription
user_idaccount number
loginlogin name
name, emailthe account’s default sender, as defined in the platform settings. Can be empty
creditsavailable email sending credits. For a subscription, this is the remaining monthly quota plus the credit, capped at the daily quota: the same figure as in the interface
ipthe caller’s IP, as the server sees it

List sub-accounts

Access point: https://www.mdworks.fr/api_http/user_list

This method returns the list of sub-accounts under your main account.

Parameters: none apart from api_key.

Example of posted data:

{"api_key": "YOUR_API_KEY"}

Response: an array of objects.

FieldDescription
idunique ID of the sub-account
logunique login of the sub-account
passpassword of the sub-account
nomname of the sub-account (optional, used for display)
emailemail of the sub-account’s technical contact (used to send complaint reports and delisting reports)
quotasending quota assigned to the sub-account
classe_domainesID of the IP pool assigned to the sub-account (see pools_list)
[
  {
    "id": "2123",
    "log": "user1",
    "pass": "password",
    "nom": "Name 1",
    "email": "tes@test.com",
    "quota": "250000",
    "classe_domaines": "7"
  },
  {
    "id": "2124",
    "log": "user2",
    "pass": "password",
    "nom": "Name 2",
    "email": "tes@test.com",
    "quota": "12354",
    "classe_domaines": "8"
  }
]

Retrieve a sub-account’s API key

Access point: https://www.mdworks.fr/api_http/get_sub_account_api_key

This method returns the API key of a sub-account under your main account. If the sub-account has no key yet, one is created.

Parameters:

ParameterTypeRequiredDescription
user_idintegeryesID of the sub-account (see user_list)

Example of posted data:

{"api_key": "YOUR_API_KEY", "user_id": 33}

Response:

FieldDescription
user_idunique ID of the sub-account
api_keyits API key
{
  "user_id": 33,
  "api_key": "SUB_ACCOUNT_API_KEY"
}

Errors:

MessageCause
Error one argument is missinguser_id is missing
User_id should be numeric
User_id does not existsthe sub-account does not exist or does not belong to your account

List available IP pools

Access point: https://www.mdworks.fr/api_http/pools_list

This method returns the IP pools assigned to your main account. If you have several IP pools, you can choose which pool to assign to each of your sub-accounts.

Parameters: none apart from api_key.

Example of posted data:

{"api_key": "YOUR_API_KEY"}

Response: an array of objects.

FieldDescription
idunique ID of the IP pool
nomname of the IP pool
domaine_expediteurdefault sender domain name
domaine_trackingdomain name used for link tracking
ip_rangerange where the IPs are located (for your SPF records)
nb_ipnumber of available IPs
tracking_ssl1 if the SSL certificate is installed on the tracking domain, 0 otherwise
[
  {
    "id": "527",
    "nom": "Classe 527 - Client XYZ - Premium MTA 101",
    "domaine_expediteur": "domaine1.com",
    "domaine_tracking": "domaine1.com",
    "ip_range": "91.209.225.64/25",
    "nb_ip": "2",
    "tracking_ssl": "1"
  },
  {
    "id": "545",
    "nom": "Classe 545 - Client XYZ - Premium MTA 101",
    "domaine_expediteur": "domaine3.com",
    "domaine_tracking": "domaine3.com",
    "ip_range": "91.209.225.64/25",
    "nb_ip": "2",
    "tracking_ssl": "1"
  }
]

Create a sub-account

Access point: https://www.mdworks.fr/api_http/user_create

This method creates a sub-account. The sub-account’s login must be unique in the database.

Parameters:

ParameterTypeRequiredDescription
logtextyeslogin of the sub-account, at least 6 characters long and as specific as possible, since it must be unique in the database. No special characters or accents
passtextyespassword, at least 8 characters long
quotaintegeryesmaximum sending quota, which cannot exceed the main account’s quota
nomtextnodefault sender name, can be empty
emailtextnodefault sender email, can be empty
pool_ipintegernoID of the IP pool to assign to the sub-account (see pools_list). If missing, the main account’s IP pool is used

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "log": "user_test_new",
  "pass": "N5tkgGR8gCnsv3Dl7",
  "quota": "50"
}

Response: the ID of the new sub-account.

{"user_id": "8458"}

Errors:

MessageCause
Error one argument is missinglog, pass or quota is missing
Login should be at least 6 characters longlogin too short (the message has two spaces before the 6)
Login should be at least 8 characters longpassword too short (the message mentions the login)
Error login existslogin already in use
Quota should be numeric
Quota should be less than Nquota higher than the main account’s
Pool Ip should be numeric
Pool Ip is not associated to this accountIP pool that does not belong to your account

Edit a sub-account

Access point: https://www.mdworks.fr/api_http/user_update

Only the parameters you send are changed, the others stay as they are.

Parameters:

ParameterTypeRequiredDescription
user_idintegeryesID of the sub-account to edit
passtextnopassword, at least 8 characters long
quotaintegernomaximum sending quota, which cannot exceed the main account’s quota
nomtextnoname of the sub-account (display only)
emailtextnoemail of the sub-account’s technical contact, who receives complaint and delisting reports
pool_ipintegernoID of the IP pool to assign to the sub-account (see pools_list)
White label: put one of your own addresses in email, so that the end customer does not receive messages from Ediware.

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "user_id": "335",
  "quota": "45"
}

Response:

{"result": "ok"}

Errors:

MessageCause
Error user_id is missing
problem with this userthe sub-account does not exist or does not belong to your account
Pass should be 8 character longpassword too short
Quota should be numeric
Quota should be less than Nquota higher than the main account’s
Pool Ip should be numeric
Pool Ip is not associated to this accountIP pool that does not belong to your account

Delete a sub-account

Access point: https://www.mdworks.fr/api_http/user_delete

A sub-account can only be deleted if no campaign has been sent from it.

Parameters:

ParameterTypeRequiredDescription
user_idintegeryesID of the sub-account to delete (see user_list)

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "user_id": "4781"
}

Response:

{"result": "ok"}

Errors:

MessageCause
UID missinguser_id is missing
problem with this userthe sub-account does not exist or does not belong to your account

Change an account’s interface language

Access point: https://www.mdworks.fr/api_http/user_lang

This method changes the default language of the platform interface, for your account or for one of your sub-accounts.

Parameters:

ParameterTypeRequiredDescription
user_idintegernoID of the account to edit (see user_list). If missing, your main account’s language is changed
langcodeyesfr, en, it, es or de
Do not confuse with the language parameter of campaign_create. user_lang sets the language of the account’s interface, with 5 lowercase codes. language sets the language of the email footer of a campaign (unsubscribe link), with 11 two-letter codes, and English is written UK there. The two settings are independent and do not share their codes.

Example of posted data:

{
  "api_key": "YOUR_API_KEY",
  "user_id": "4781",
  "lang": "en"
}

Response:

{"result": "ok"}

Errors:

MessageCause
Problem with this userthe sub-account does not exist or does not belong to your account
Correct values for lang are fr, en, it, es, deunknown language code
Last updated on