Agent.Copy
  • 14 May 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Agent.Copy

  • Dark
    Light
  • PDF

Article summary

Description

When the DestinationAccountKey is included, it copies an existing agent to a different account. When the DestinationAccountKey isn't included, then the agent will duplicate in the same account followed by '-Copy'.

To find the DestinationAccountKey go to your Departments list,
Or,
Go to Web Console > Click > Click Account Settings > Account Information.

Warning!

Avoid running 3 Agent.Copy/Agent.Move processes at once.

URL parameters

URL parameter ordering

The URL parameters below are listed in the order they should be entered in the API URL.

NameRequiredTypeDescription
AgentIDTruenumericUnique identifier of the copied agent.
DestinationAccountKeyFalsestringUnique identifier of the new account destination for the copied agent.
AgentGroupIDFalsenumericUnique identifier of the agent group.
CopyDataFalsebooleanYes, No, True, False. Yes/True to copy the agent's data.
IncludeAgentRunScheduleFalsebooleanYes, No, True, False. Yes/True to include agent run schedule.
IncludePublishSettingsFalsebooleanYes, No, True, False. Yes/True to include publish settings.
IncludeAgentNotificationsFalsebooleanYes, No, True, False. Yes/True to include agent notifications.
NameFalsestringName of the copied agent.

Responses

NameTypeDescription
ResultstringSuccess if the operation was successful.
BatchIDnumericalUnique identifier used to monitor the progress of the Agent.Copy Get request.
Note

Get the status of the API call of the copied agent in Agent.GetMoveCopyStatus.

Sample request

curl -X GET "https://api.mozenda.com/rest?WebServiceKey=XXXXXXXX -XXXX-XXXX-XXXX-XXXXXXXXXXXX&Service=Mozenda10&Operation=Agent.Copy&AgentID=1044&DestinationAccountKey=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"

Sample responses

XML

<?xml version="1.0" encoding="utf-8"?>
<CopyResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <Result>Success</Result>
  <BatchID>32553</BatchID>
</CopyResponse>

JSON (add &ResponseFormat=JSON)

{
"BatchID": 32555,
   "JsonResult": {
      "Command": "Agent.Copy",
      "AutoLoggedIn": false,
      "WebConsoleKey": "",
      "Result": "Success",
      "ErrorCode": "",
      "ErrorDescription": "",
      "ErrorList": [],
      "ExecutionTime": {
         "Ticks": 0,
         "Days": 0,
         "Hours": 0,
         "Milliseconds": 0,
         "Minutes": 0,
         "Seconds": 0,
         "TotalDays": 0,
         "TotalHours": 0,
         "TotalMilliseconds": 0,
         "TotalMinutes": 0,
         "TotalSeconds": 0
      }
   }
}

Was this article helpful?