Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

...

...

...

...

...

...

...

...

...

...

 

Toc

Management

Use these methods to retrieve informations about your environment (profiles, packages and languages).

Note that management requests ignore ExternalUserId value, so your client can perform these request with or without this value.

Get retailer-defined profiles

...

Description

...

Get retailer-defined profiles

...

HTTP Method

...

GET

...

URL

...

Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile

...

JSON request (example)

...

none

...

JSON response (example)

...


Info

This page is a reference manual for the API to be used for developing a custom solution of automatic account provisioning. MailUp APS is built on top of this API and it should be your first option for account provisioning. As for the MailUp APS, the access to this API is not "self-service", you should first contact us to ask for enabling your application for account provisioning and to agree on setup details.



On this page:

 

Toc

Management

Use these methods to retrieve pieces of information about your environment (profiles, packages, and languages) and configure your environment.

Note that all management resource requests ignore ExternalUserId value, so your client can perform these requests having or not this value.

Anchor
GetProfiles
GetProfiles
Get retailer-defined profiles

Description

Get retailer-defined profiles

HTTP Method

GET

URL


Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile


JSON request (example)

none

JSON response (example)


Expand


Code Block
HTTP/1.1 200 OK
 
{
	"IsPaginated":false,
	"Items":[
		{
			"ClientCode":1,
			"Description":"Trial",
			"Id":1046,
			"Name":"Trial"
		},
		{
			"ClientCode":2,
			"Description":"Economy",
			"Id":1047,
			"Name":"Economy"
		},
		{
			"ClientCode":3,
			"Description":"Premium",
			"Id":1048,
			"Name":"Premium"
		}],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":3
}



Paging and filtering (example)

  • Retrieving the first page with two items:

    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile?PageSize=2


  • Retrieving the second page with two items:

    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile?PageSize=2&PageNumber=1


Anchor
GetPacks
GetPacks
Get retailer-defined packages by profile

To retrieve available languages you need to provide this parameter:


RequiredWhereDescription
id_ProfileXURLSee get profile


Description

Get retailer-defined profile-packages relationship

HTTP Method

GET

URL


Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Pack


JSON request (example)

none

JSON response (example)


Expand



Code Block
HTTP/1.1 200 OK
 
{
	"IsPaginated":false,
	"Items":[
		{
			"ClientCode":1,
			"Description":"Pacchetto che consente di aumentare la velocità di invio di 300 mail\/ora",
			"Id":534,
			"Max":5,
			"Min":1,
			"Name":"VelocitaAggiuntiva300"
		},
		{
			"ClientCode":2,
			"Description":"Pacchetto che consente di aggiungere 300 crediti alla console",
			"Id":535,
			"Max":65535,
			"Min":1,
			"
Description
Name":"
Trial
Crediti300"
,

		}],
	"
Id
PageNumber":
1046
0,
	
"
Name
PageSize":
"Trial" }
20,
{
	"
ClientCode
Skipped":
2
0,
	
"
Description
TotalElementsCount":
"Economy", "Id":1047, "Name":"Economy" }, { "ClientCode":3, "Description":"Premium", "Id":1048, "Name":"Premium" }], "PageNumber":0, "PageSize":20, "Skipped":0, "TotalElementsCount":3 }

Paging and filtering (example)

none

Get retailer-defined packages by profile

Description

Get retailer-defined profile-packages relationship

HTTP Method

GET

URL

Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Pack

JSON request (example)

none

JSON response (example)

Expand

 

 

Code Block
{
	"IsPaginated":false,
	"Items":[
		{
			"ClientCode":1,
			"Description":"Pacchetto che consente di aumentare la velocità di invio di 300 mail\/ora",
			"Id":534,
			"Max":5,
			"Min":1,
			"Name":"VelocitaAggiuntiva300"
		},
		{
			"ClientCode":2,
			"Description":"Pacchetto che consente di aggiungere 300 crediti alla console",
			"Id":535,
			"Max":65535,
			"Min":1,
			"Name":"Crediti300"
		}],
	"PageNumber":0,
	"PageSize":20,
	"Skipped":0,
	"TotalElementsCount":2
}

 

 

Paging and filtering (example)

none

Errors

HTTP Status CodeWhenMessage
403 ForbiddenUnexisting id_profileYou cannot access to provided profile.
id_profile not assigned to specified Retailer account

Note

  1. Min e Max equals to the number of packages manageable by selected profile.

Get reseller's available languages by profile

Description

Get the available languages by profile

HTTP Method

GET

URL

Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Lang

JSON request (example)

none

JSON response (example)

Expand

 

 

Code Block
 [
    "JA",
    "ID",
    "IT",
    "ES",
    "FR",
    "PT",
    "ZH",
    "EN"
  ]

 

 

Paging and filtering (example)

none

Errors

HTTP Status CodeWhenMessage
403 ForbiddenUnexisting id_profileYou cannot access to provided profile.
id_profile not assigned to specified IdConsoleRetailer

Account

Create a reseller's customer account

Http verb
Status
colourBlue
titlePOST
Resource URLAccount/Activation/Profile/
2
}




Paging and filtering (example)

  • Retrieving the first page with two items:

    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Pack?PageSize=2


  • Retrieving the second page with two items:

    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Pack?PageSize=2&PageNumber=1


Errors

HTTP Status CodeWhenMessage
403 ForbiddenUnexisting id_profileYou cannot access the provided profile.
id_profile not assigned to a specified Retailer account

Note

  1. Min e Max equals the minimum and a maximum number of packages manageable by selected profile.

Anchor
GetLanguages
GetLanguages
Get the
available languages by profile

To retrieve available packages you need to provide this parameter:


RequiredWhereDescription
id_ProfileXURLSee get profile


Description

Get the available languages by profile

HTTP Method

GET

URL


Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Management/Profile/{id_Profile}/Lang


JSON request (example)

none

JSON response (example)


Expand



Code Block
HTTP/1.1 200 OK
 
 [
    "JA",
    "ID",
    "IT",
    "ES",
    "FR",
    "PT",
    "ZH",
    "EN"
  ]




Paging and filtering (example)

none

Errors

HTTP Status CodeWhenMessage
403 ForbiddenUnexisting id_profileYou cannot access the provided profile.
id_profile not assigned to specified IdConsoleRetailer

Account

 Use these methods to manage retailers' customer's accounts. With these methods, you can create new accounts, add or remove packages and get what you need to log in to accounts.

Note that all account resource requests need an ExternalUserId value, so you have to authenticate specifying the retailer's customer unique identifier. APIs validates client requests forbidden the access if:

  • AccessToken contains an empty ExternalUserId
  • AccessToken contains an ExternalUserId that hasn't got the right scope to perform the required operation.

Anchor
CreateAccount
CreateAccount
Create a retailer's customer account

The process to create an account could take some time. To create a new account you have to provide this information:


RequiredWhereDescription
id_ProfileXURLSee get profile
langXURLSee get languages
IpAddressXBodyYour client IP address
EmailXBodyYour customer's email address
CustomDomainXBodyYour product or your customer domain
CustomSubdomainXBodyYour product or your customer subdomain to address this service
ServiceNameXBodyYour product name
ServiceUrlXBodyYour product web site
ServiceLogoutUrlXBody

Address to redirect the customer when logouts

UserAgent
BodyYour client user agent
Referer
BodyYour client referer

This method returns an activation identifier to prevent client hanging. When the method responds, your clients have to poll the activation status method to understand when the creation process ends. The response could contain domains that should be redirected to MailUp CNAMEs adding DNS records.


Code: 4,

Description

Create a retailer's customer account

HTTP Method

POST

URL


Code Block
https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/Activation/Profile/{id_Profile}/Language/{lang}
Request API
 RequiredWhere
id_ProfileXURL
langXURL
IpAddressXForm request
UserAgent Form request
Referer Form request
EmailXForm request
CustomDomainXForm request
CustomSubdomainXForm request
ServiceNameXForm request
ServiceUrlXForm request
ServiceLogoutUrlXForm request
Request ADM
 RequiredWhoWhere
ExternalUserIdXAuthorizationCodeAuthorization Flow
IdAnagraficaXIdAnagrafica field of Newsletter table where id = DeveloperId of APIConsumerApplicationDatabase
IdProfiloXGiven by ResellerRequest API
IPXGiven by ResellerRequest API
UserAgent Given by ResellerRequest API
Referer Given by ResellerRequest API
EmailXGiven by ResellerRequest API
LangXGiven by ResellerRequest API
CustomDomainXGiven by ResellerRequest API
Return value

An object containing these fields:

  • id_Activation
  • Hash
  • Code
  • Description
  • ControlPanelDomain
  • LinkTrackingDomain
  • ImageTrackingDomain. 
Code and description return these values:
  • Code: -1, Description: Unknown account activation status
  • Code: 0, Description: Ok
  • Code: 1, Description: Processing
  • Code: 2, Description: Error
  • Code: 3, Description: Language 'XX' is not available for profile YY.

  • JSON request (example)


    Expand


    Code Block
    {
    	"IpAddress":"192.168.0.1",
    	"Email":"service@retailer.it",
    	"CustomDomain":"power-email-marketing.it",
    	"CustomSubdomain":"customer123",
    	"ServiceName":"Power email marketing",
    	"ServiceUrl":"www.power-email-marketing.it/info",
    	"ServiceLogoutUrl":"www.power-email-marketing.it",
    	"Referer":"",
    	"UserAgent: ""
    }



    JSON response (example)


    Expand


    Code Block
    HTTP/1.1 200 OK
     
    {
    	"Code":0,
    	"Description":"Ok",
    	"IdActivation":9054,
    	"Hash":"767eed52-be08-4eb4-8658-5db4eaa215e1",
    	"ControlPanelDomain":"customer123.mailadmin.io",
    	"ImageTrackingDomain":"img.customer123.t.power-email-marketing.it",
    	"LinkTrackingDomain":"customer123.t.power-email-marketing.it"
    }



    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestUnexisting lang value into the TwoLetterISOLanguageName list.Invalid language.
    ExternalUserId empty.Invalid ExternalUserId.

    403 Forbidden


     

    No profiles for the ResellerId authentication code value.

    You cannot access the provided profile.
    Internal error occurred

    Code: -1

    Description: Unknown account activation status.

    You are not able to create this account

    Code: 2

    Description: Error

    Language provided is not allowed for this retailer's edition

    Code: 3

    Description: Language '{lang}' is not available for profile {id_Profile}.

    IpAddress is null, empty, or IPAddress.TryParse fails

    Code: 4

    Description: IpAddress cannot be null, empty, or invalid.

    IpAddress is null, empty, or EmailHelper.ValidateAddress fails

    Code: 5

    ,

    Description: Email cannot be null, empty, or invalid.

    The request contains some null, empty, or invalid domain fields

    Code: 6

    ,

    Description: Domains cannot be null, empty, or invalid.

    One or more domains not available

    Code

    :

    = 7

    ,

    ;

    Description: Custom domain not available.

    Code: 8

    ,

    ;

    Description: Link tracking domain not available

    Code: 9

    ,

    ;

    Description: Image tracking domain not available

    Code: 10,
    Invalid retailer's service information

    Code: 10;

    Description: Service name cannot be null, empty, or invalid.

    Code: 11

    ,

    ;

    Description: Service

    url

    URL cannot be null, empty, or invalid.

    Code: 12

    ,

    ;

    Description: Service logout

    url

    URL cannot be null, empty, or invalid.

    WHEN REQUESTS RUN:

    • ExternalUserId, id_Profile, lang, IpAddress, Email, ServiceName, ServiceUrl, ServiceLogoutUrl CustomSubdomain and CustomDomain MUST HAVE a value
    • UserAgent and Referer could be empty

    WHEN REQUESTS FAIL:

    ...

    403 Forbidden

    ...

    No profiles for the ResellerId authentication code value.

    ...

    Code: 4

    Description: IpAddress cannot be null, empty or invalid.

    ...

    Code: 5

    Description: Email cannot be null, empty or invalid.

    ...

    Code: 6

    Description: Custom domain cannot be null, empty or invalid.

    ...

    Code = 7;

    Description = Custom domain not available.

    ...

    Code: 3

    Description: Language '{lang}' is not available for profile {id_Profile}. 

    NOTE:

    1. E' possibile creare UN SOLO account TRIAL per ExternalUserId. Se si cerca di creare un account trial utilizzando un ExternalUserId già utilizzato, la risposta conterrà Code: 1, Description: Processing fino a che il primo account non è stato creato, ed al termine della sua creazione conterrà Code: 2, Description: Error.
    2.  E' possibile creare PIU' account ECONOMY o PREMIUM per ExternalUserId. Se si cerca di creare un account economy o premium utilizzando un ExternalUserId già utilizzato, la risposta conterrà Code: 1, Description: Processing fino a che il primo account non è stato creato, ed al termine della sua creazione conterrà Code: 0, Description: Ok.

    Get reseller's customer account profile activation status

    ...

    Account/Activation/{id_Activation}/Status

    NOTE: the id_Activation is the value returned with Create a reseller's customer account resource

    ...

     RequiredWhere
    id_ActivationXURL

    ...

     RequiredWhoWhere
    id_ActivationXGiven by ResellerRequest API

    ...

    An object (like ConsoleActivationStatusResponse object for PublicService) containing:

    • Code (0: Ok, 1: Processing, 2: Error, 3: An error occurred finalizing account creation)
    • Description (Ok, Processing, Error, An error occurred finalizing account creation)
    • IdAccount

    NOTE: the IdAccount field contains a value ONLY when the reseller's customer console is propertly created, so Code field contains the OK-CREATED code value.

    NOTE2: the IdAccount equals to ConsoleId

    WHEN REQUESTS RUN:

    • ExternalUserId and id_Activation MUST HAVE a value
    • id_Activation MUST be a numeric value

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails
    id_Activation is not a numberInvalid activation.

     

    Change reseller's customer account profile

    ...

    Status
    colourYellow
    titlePUT

    ...

    Note

    1. It is possible to create ONLY ONE Trial Control Panels per ExternalUserId. If you try to create more Trials using the same ExternalUserId the response contains Code: 1, Description: Processing until the process ends, and then it contains  Code: 2, Description: Error.
    2. It is possible to create MORE non Trial Control Panels per ExternalUserId. If you try to create more non Trials using the same or another ExternalUserId the response contains Code: 1, Description: Processing until the process ends, and then it contains Code: 0, Description: Ok.

    Anchor
    GetActivationStatus
    GetActivationStatus
    Get retailer's customer account profile activation status

    Finalize your account creation process checking its status. To finalize a new account creation process you have to provide this information:


    RequiredWhereDescription
    id_ActivationXURLSee create account


    Description

    Get retailer's customer account profile activation status

    HTTP Method

    GET

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/Activation/{id_Activation}/Status


    JSON request (example)

    none

    JSON response (example)


    Expand

    The system is creating your new account:

    Code Block
    HTTP/1.1 201 Accepted
     
    {
    	"Code":1,
    	"Description":"Processing",
    	"IdAccount":0
    }


    New account created successfully:

    Code Block
    HTTP/1.1 200 OK
     
    {
    	"Code":0,
    	"Description":"Ok",
    	"IdAccount":23052
    }




    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails
    id_Activation is not a numberInvalid activation.

    403 Forbidden

    Unknown account activation status phase


    Code = -1

    Description = Unknown account activation status

    Account activation failed

    Code = 2

    Description = Error

    Link or image tracking domains, service name, URL, or logout URL cannot be set

    Code = 3

    Description = An error occurred finalizing account creation

    Note

    1. the IdAccount field contains a value ONLY when the new account is properly created, so the Code field contains the 0 - OK code value.


    Change retailer’s customer account profile

    Method to change the profile. To change your account profile you have to provide this information:


    RequiredWhereDescription
    id_AccountXURLSee activation status response
    id_ProfileXURLSee get profiles


    Description

    Change retailer’s customer account profile

    HTTP Method

    PUT

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}/Profile/{id_Profile}

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    Request API
     RequiredWhere
    id_AccountXURL
    id_ProfileXURL
    Request ADM
     RequiredWhoWhere
    id_AccountXGiven by ResellerRequest API
    id_ProfileXGiven by ResellerRequest API
    Return value

    -

    NOTE:


    JSON request (example)

    none

    JSON response (example)

    none

    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    403 Forbidden

    Invalid id_profile


    You cannot access the provided profile.

    Invalid id_account

    You cannot access the provided account.

    Note

    1. the return value is the HTTP

    ...

    1. status code of the response.

    ...

    1. API executes this operation asynchronously. Every time the

    ...

    1. client invokes the

    ...

    1. method,

    ...

    1. it returns a code. If this code tells that the operations are still in progress the resource returns

    ...

    1. a 202 Accepted status code; otherwise returns a 200 OK status code. If an error occurred it returns 500 Internal Server Error.

    ...

    1. the

    ...

    1. client can invoke the

    ...

    1. resource as many times as it wants.

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    ...

    Get retailer's customer account

    ...

    Status
    colourYellow
    titlePUT

    ...

    Account/{id_Account} or Account/{id_Account}?Enable=false

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    ...

    status

    Method to verify the account status. To retrieve the account status you have to provide this information:


    RequiredWhereDescription
    id_AccountXURL
    Enable QuerystringRequest ADMNoneReturn value

    The resource returns a 200 OK status code and and object containing account status properties.

    In detail the returned object actually contains:

      • Code: int value corresponding to the account status code
        • 0: Active
        • 1: Deactivated
      • Description: human readable description of the account status code
        • Active
        • Deactivated
      • ValidFrom: String corresponding to the validity start date
      • ValidTo: String corresponding to the validity end date

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Enable reseller's customer account info

    Http verb
    Status
    colourYellow
    titlePUT
    Resource URLAccount/{id_Account} or
    See activation status response 

    The table below shows the possible status, specifying related response fields meaning:

    StatusResponse Code field valueResponse Description field value
    Error / Processing-1Error or Processing
    Enabled0Enabled
    Disabled1Disabled
    Unprovided2Unprovided


    Description

    Get retailer’s customer account status

    HTTP Method

    GET

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}
    ?Enable=true

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    Request API
     RequiredWhere
    id_AccountXURL
    Enable XQuerystring
    Request ADMNoneReturn value

    The resource returns a 200 OK status code and and object containing account status properties.

    In detail the returned object actually contains:

    • Code: int value corresponding to the account status code
      • 0: Active
      • 1: Deactivated
    • Description: human readable description of the account status code
      • Active
      • Deactivated
    • ValidFrom: String corresponding to the validity start date
    • ValidTo: String corresponding to the validity end date

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Unprovide reseller's customer account

    ...

    Account/{id_Account}

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    ...

     RequiredWhere
    id_AccountXURL

    ...

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Get reseller's customer account status

    ...

    Account/{id_Account}/Status

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    ...

     RequiredWhere
    id_AccountXURL

    ...

    An object contains these fields:

    • Code (numeric)
      • 0: Enabled
      • 1: Disabled
      • 2: Unprovided
      • -1: Error or Processing
    • Description (string)
      • Enabled
      • Disabled
      • Unprovided
      • Error or Processing
    • ValidFrom (string, it's a DateTime)
    • ValidTo (string, it's a DateTime)
    • IdAccount
    • Credits
    • ActivePacks
      • Id
      • Quantity
      • CurrentQuantity

     

    WHEN REQUESTS FAIL:

    HTTP Status CodeWhenMessage400 BadRequest


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    {
    	"Code":0,
    	"Description":"Enabled",
    	"ActivePacks":[
    		{"CurrentQuantity":0,"Id":534,"Quantity":0},
    		{"CurrentQuantity":0,"Id":535,"Quantity":0},
    		{"CurrentQuantity":0,"Id":536,"Quantity":0},
    		{"CurrentQuantity":0,"Id":537,"Quantity":0},
    		{"CurrentQuantity":0,"Id":538,"Quantity":0}
    	],
    	"Credits":300,
    	"IdAccount":23053,
    	"IdProfile":1401,
    	"ValidFrom":"2015-10-14 22:00:00Z",
    	"ValidTo":"2016-10-14 22:00:00Z"
    }




    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails
    403 ForbiddenInvalid Id_AccountYou cannot access
    to
    the provided account.

    ...

    Note

    1. La chiamata ritorna -1 se il metodo GetAccountStatus dei servizi ADM ritorna come ReturnCode 1 (Processing) o 2 (Error). Tale descrizione del ReturnCode viene settata come description in modo che si possa capire il motivo del fallimento. In realtà ReturnCode, in questo caso, varrà 0 (Ok) oppure 2 (Error) e MAI 1 (Processing).
    2. La proprietà ActivePacks restituisce informazioni relative allo stato attuale dei pacchetti. Il campo Quantity restituisce la somma algebrica dei pacchetti aggiunti/rimossi, mentre CurrentQuantity fornisce informazioni relative a quanti pacchetti sono attualmente in uso (un pacchetto potrebbe essere stato rimosso, ma l'effettiva rimozione avverrà a fine mese)

    ...

    Disable retailer's customer account

    Http verb
    Status
    colourBlue
    titlePOST
    Resource URL

    Account/{id_Account}/Pack/{id_Pack}

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    Request API
     RequiredWhere
    id_AccountXURL
    id_PackXURL
    QuantityXBody
    WorkModeXBody

    WorkMode should be "incremental" or "absolute" and refers to the way to manage packages.

    The "incremental" work mode allows client to add or remove packages as defined by Quantity field. If client calls the method 3 times with quantity equals to 1, API method adds 1 package each time. If client needs to remove a package it calls the method with quantity equals to -1 and API method removes a package.

    The "absolute" work mode allows client to define the total number of packages.If client calls the method with quantity equals to 4, API method adds 4 packages. If client needs to remove 2 packages from the current quantity (set to 4 by the previews call) it calls the method with quantity equals to 2 and the API method removes 2 packages.

    NB: "absolute" work mode allows only unsigned value for Quantity.

     

    Request ADM
     RequiredWhoWhere
    id_AccountXGiven by ResellerRequest API
    id_PackXGiven by ResellerRequest API
    Return value

    In detail the returned object actually contains:

    • Code: int value corresponding to the account status code
      • 0: Ok
      • 1: Quantity_limits_exceeded
      • 2: Profile_rules_error
      • 3: Invalid_quantity
      • 4: Invalid_workmode
    • Description: human readable description of the account status code
      • Ok
      • Quantity limits exceeded
      • Profile rules error
      • Invalid quantity
      • Invalid workmode

    NOTE: the resource returns a 200 OK status code if the package was added succesfully and the response contains code = 0; if the addition does not end propertly, the resource returns a 403 Forbidden and the response contains code = 1

    WHEN REQUESTS RUN:

    • the response contains an object with:
      • Code = 0
      • Description = Ok

    WHEN REQUESTS FAIL:Method to disable an account.


    RequiredWhereDescription
    id_AccountXURLSee activation status response 
    Enable
    QuerystringCould be FALSE


    Description

    Disable retailer's customer account

    HTTP Method

    PUT

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account} 
    or 
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}?Enable=false


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    {
    	"Code":0,
    	"Description":"Ok"
    }



    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Enable reseller's customer account info

    Method to enable a disabled account. A disabled account cannot be enabled in the future.


    RequiredWhereDescription
    id_AccountXURLSee activation status response 
    EnableXQuerystringMust be TRUE


    Description

    Enable a disabled retailer's customer account

    HTTP Method

    PUT

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_account}?Enable=true


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    {
    	"Code":0,
    	"Description":"Ok"
    }



    Paging and filtering (example)

    none

    Errors

    ExternalUserId empty.Invalid ExternalUserId
    HTTP Status CodeWhenMessage
    400 BadRequest
    IdPack is not numericInvalid pack.
    ExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    403 Forbidden

     

    The package cannot be added

    the response contains an object with:

      • Code = 1
      • Description = Quantity limits exceeded
      oppure
      • Code = 2
      • Description = Profile Rules Error

    NOTE

    1. Non si possono  aggiungere/rimuovere pacchetti ad un profilo TRIAL
    2. Non di possono rimuovere pacchetti a consumo dai profili Economy e Premium
    3. La tabella RetailerProfilePack definisce il numero di pacchetti Massimo e Minimo previsti per il profilo. La visibilità del pacchetto per l'utente finale (e quindi la sua attivabilità) è gestita con il campo IsActivable.
    4. Nel caso la risposta abbia lo status code settato a 403 Forbidden si ottiene la risposta con Code=1 quando la richiesta non viene validata dai limiti previsti dalla tabella RetailerProfilePack, mentre Code=2 quando la validazione secondo i limiti della tabella retailerProfilePack è ok ma fallisce l'operazione lato ADM. Un caso in cui può essere ritornato Code=2 è quando s cerca di cancellare un pacchetto a consumo (crediti).

    Get reseller's customer account logins

    The resource allows to retrieve the logins available for this account/console. It is necessary if the reseller allows his customers to add more administrators to an account.

    ...

     RequiredWhere
    id_AccountXURL

    ...

    A list of AccountLogin object containing:

    • idLogin
    • Username

    NOTE: data come from Newsletters_Login table. idLogin is the id and UserName is the username fields

    ...

    Unprovide reseller's customer account

    Method to unprovide an account. An unprovided account cannot be enabled in the future.


    RequiredWhereDescription
    id_AccountXURLSee activation status response 


    Description

    Unprovide a retailer's customer account

    HTTP Method

    DELETE

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    {
    	"Code":0,
    	"Description":"Ok"
    }



    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Add the package to the retailer's customer account

    Method to add packages to the selected account.


    RequiredWhereDescription
    id_AccountXURLSee activation status response 
    id_PackXURLSee get packages
    QuantityXBodyNumeric value that depends on WorkMode. Please refer to the row below.
    WorkModeXBody

    Should be "incremental" or "absolute" and refers to the way to manage packages.

    The "incremental" work mode allows the client to add or remove packages as defined by the Quantity field. If a client calls the method 3 times with quantity equals 1, the API method adds 1 package each time. If a client needs to remove a package it calls the method with quantity equals to -1 and the API method removes a package.

    The "absolute" work mode allows the client to define the total number of packages. If a client calls the method with quantity equals 4, the API method adds 4 packages. If a client needs to remove 2 packages from the current quantity (set to 4 by the previews call) it calls the method with quantity equals 2 and the API method removes 2 packages.

    NB: "absolute" work mode allows only unsigned value for Quantity.


    Description

    Add the package to the retailer's customer account

    HTTP Method

    POST

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}/Pack/{id_Pack}


    JSON request (example)


    Expand

    Incremental:

    Code Block
    {
    	"Quantity":-3,
    	"WorkMode":"incremental"
    }

    Absolute:

    Code Block
    {
    	"Quantity":3,
    	"WorkMode":"absolute"
    }



    JSON response (example)


    Expand


    Code Block
    {
    	"Code":0,
    	"Description":"Ok"
    }

    The resource returns a 200 OK status code if the package was added successfully and the response contains code = 0; if the addition does not end properly, the resource returns a 403 Forbidden and the response contains:

    CodeDescriptionMeaning
    1

    Quantity limits exceeded

    The number of packages you are trying to add/remove exceeds the profile limits

    2

    Profile rules error

    The number of packages you are trying to add/remove exceeds some profile rule limit (for example, you cannot remove a package related to SMS)

    3

    Invalid quantity

    This error condition appears when the work mode equals “absolute” and the quantity value is negative

    4

    Invalid work mode

    The WorkMode field should be “incremental” or “absolute” ONLY





    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestIdPack is not numericInvalid pack.
    ExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Note

    1. It is impossible to remove packages from the TRIAL profile
    2. It is impossible to remove credits-related packages

    Anchor
    GetLogins
    GetLogins
    Get retailer's customer account logins

    The resource allows retrieving the logins available for this account/console. It is necessary if the retailer allows his customers to add more administrators to an account.


    RequiredWhereDescription
    id_AccountX

    URL

    See activation status response 


    Description

    Unprovide a retailer's customer account

    HTTP Method

    GET

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}/Login


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    {
    	"IsPaginated":false,
    	"Items":[
    		{
    			"IdLogin":45792,
    			"Username":"user1"
    		},
    		{
    			"IdLogin":45793,
    			"Username":"user2"
    		}],
    	"PageNumber":0,
    	"PageSize":20,
    	"Skipped":0,
    	"TotalElementsCount":2
    }



    Paging and filtering (example)

    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}/Login?PageSize=2&PageNumber=1

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

    Get

    ...

    retailer's customer account login

    ...

    URL

    The method provides the URL to log in to the account.


    RequiredWhereDescription
    id_AccountXURLSee activation status response 
    id_LoginXURLSee get logins response


    Description

    Get retailer's customer account login URL

    HTTP Method

    GET

    URL


    Code Block
    https://services.mailup.com/API/v1.1/Rest/RetailerService.svc/Account/{id_Account}/Login/{id_Login}

    NOTE: the id_Account is the value returned with Get reseller's customer account profile activation status resource

    Request API
     RequiredWhere
    id_AccountXURL
    Request ADM-Return valueThe reseller's customer account login url string

    ...


    JSON request (example)

    none

    JSON response (example)


    Expand


    Code Block
    "http:\/\/mailup_trial.mailadmin.io\/Console\/Login.aspx?Code=2f3g3m0G2K3L1B242A1f412E0a2118373c1T1f0e1F39452a373z2P2h0n0Z3L3a2j3H2707350C3j030L3Y0O3t1A2y4032373Q3c0S2O3F1I343I0g3O0b3d050L1m-1r2K1C01041D3F013e2A0E1X3b1T3a0W1H4128020k0z0R180P053b3j1r3G152C"



    Paging and filtering (example)

    none

    Errors

    HTTP Status CodeWhenMessage
    400 BadRequestExternalUserId empty.Invalid ExternalUserId.
    ExternalUserId validation fails

     

    ...