Skip to main content

UpdateAccount v3.1

This API call is used to modify account details related to link tracking on the account.

Deprecated Versions​

(none)

Required Parameters​

ParameterDescription
ActionUpdateAccount
AccountIdThe MessageGears account id to which this item belongs.
ApiKeyA secret key only known by you. Keep this key confidential.
IdThe ID of the account to be updated.

Optional Parameters​

ParameterDescription
NameChange the name of the account
AutoTrackChange the default value for all jobs sent through this account to β€œtrue” or β€œfalse”
UrlAppendChange the default string to be appended to all tracking links for this account
CustomTrackingDomainChange the default domain to be used for all tracking URLs (click, open, unsubscribe

Programming Examples​

REST​

Request

https://api.messagegears.net/3.1/WebService  
?Action=UpdateAccount
&AccountId=123456789
&ApiKey=8bb6118f8fd6935ad0876a3be34a717d32708ffd
&Id=70916599
&Name=Quality Assurance Account

Response

<UpdateAccountResponse>  
<RequestId>e311-89fff13f-9866-4e5d-856f-7bd01cb612d3</RequestId>
<Result>REQUEST_SUCCESSFUL</Result>
</UpdateAccountResponse>

Java SDK​

Click here for more information on using the MessageGears Java SDK

package com.messagegears.examples;

import com.messagegears.sdk.MessageGearsClient;
import com.messagegears.sdk.MessageGearsProperties;
import com.messagegears.sdk.model.request.UpdateAccountRequest;
import com.messagegears.sdk.output.ScreenWriter;
import com.messagegears.sdk.v3_1.UpdateAccountResponse;

public class UpdateAccount {

public static final String MY_EMAIL_ADDRESS = "place your email address here";
public static final String MY_MESSAGEGEARS_ACCOUNT_ID = "place your MessageGears account id here";
public static final String MY_MESSAGEGEARS_API_KEY = "place your MessageGears api key here";

public static void main(String[] args) {
// Update the properties object containing the necessary properties
MessageGearsProperties properties = new MessageGearsProperties();
properties.setMyMessageGearsAccountId(MY_MESSAGEGEARS_ACCOUNT_ID);
properties.setMyMessageGearsApiKey(MY_MESSAGEGEARS_API_KEY);

// Update the main client object
MessageGearsClient client = new MessageGearsClient(properties);

// Update a bulk campaign request
UpdateAccountRequest request = new UpdateAccountRequest();

// Set the URL where the recipient XML file can be retrieved
request.setName("QA Account");

// Set auto link tracking to true
request.setAutoTrack(true);

// Execute the request
UpdateAccountResponse response = client.updateAccount(request);

// Print the result (success or failure)
ScreenWriter.printResponse(response);
}
}

C# SDK​

Click here for more information on using the MessageGears .Net SDK

using System;
using MessageGears;
using MessageGears.Model;
using MessageGears.Model.Generated;

namespace MessageGears.Sample
{
public class UpdateAccountSample
{
// Replace this value with your email address
public const String MY_EMAIL_ADDRESS = "place your email address here";
public const String MY_MESSAGEGEARS_ACCOUNT_ID = "place your MessageGears account id here";
public const String MY_MESSAGEGEARS_API_KEY = "place your MessageGears api key here";

public static void Main()
{
// Create the properties object containing the necessary properties
MessageGearsProperties props = new MessageGearsProperties();
props.MyMessageGearsAccountId = MY_MESSAGEGEARS_ACCOUNT_ID;
props.MyMessageGearsApiKey = MY_MESSAGEGEARS_API_KEY;

// Create the main client object
MessageGearsClient client = new MessageGearsClient(props);

// Create a bulk campaign request
UpdateAccountRequest request = new UpdateAccountRequest();

// Set the Account Name
request.Name = "QA Account";

// Set the default for Auto Tracking of links
request.AutoTrack = false;

// Execute the request
UpdateAccountResponse response = client.UpdateAccount(request);

// Print the result (success or failure)
client.PrintResponse(response);
}
}
}