Page tree
Skip to end of metadata
Go to start of metadata

Method parameters:

CreateGroup(int idList, int listGUID, string newGroupName)

Creates a new group for the specified list.

  • idList: list identifier
  • listGuid: GUID of the list
  • newGroupName: name of the group to be created

 

The returned value is the ID of the created group.

If a group with the same name already exists in the list, then no new group is created and the ID of the existing group is returned.

Maximum allowed lenght for Group names is 50 characters, if you specify more than 50 characters the actual Group name will be truncated by MailUp



Sample CreateGroup response

<mailupMessage>
  <mailupBody>
    <ReturnCode>12</ReturnCode>
  </mailupBody>
</mailupMessage>

Error codes 

Error codeDescription
-300unrecognized error
-301the list has not been specified
-302the group name has not been specified
-303the group already exists

Ruby Example

# Refer to https://mailup.atlassian.net/wiki/display/mailupapi/MailUp+RubyGem for gem information.
require 'mailup'
m = MailUp::Import.new('username', 'password', 'console_url')
m.create_group(:idList => 123456, :listGuid => 'abc123', :newGroupName => 'Sample Group')
# => <?xml version=\"1.0\" encoding=\"windows-1252\" ?><mailupMessage><mailupBody><ReturnCode>12</ReturnCode></mailupBody></mailupMessage>

 

 

  • No labels

2 Comments

  1. Anonymous

    If a group with the same name already exists in the list, then no new group is created and an error code is returned, otherwise the ID of the created group is returned.

    If I call this method with the same group name, it doesn't return any error, instead it returns the existing group id.

    Are the docs wrong, or it's supposed to work this way?

    1. The documentation was wrong, please refer to the blue "info box" above for the correct information.