Skip to main content
Aria Knowledge Central

copy_plan_m Sample Call and Response

This example shows a call to copy_plan_m that copies an existing plan and assigns the resulting new plan a new name and a new client-defined identifier. It is based on methods_m_r73.yml, Admin Tools API.

This example includes every required field, along with the two optional fields you use most often when copying a plan: a new plan name and a new client-defined plan identifier. It does not cover every optional field the method accepts.

Sample call

{
  "rest_call": "copy_plan_m",
  "output_format": "json",
  "client_no": 10023,
  "auth_key": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
  "plan_no": 20481,
  "plan_name": "Premium Streaming - Annual (Copy)",
  "new_client_plan_id": "PREM-STREAM-ANN-2026"
}

The fields rest_call and output_format are REST-layer additions that sit outside the method’s own documented arguments in the yml; you supply rest_call with the method name and output_format with json to request a JSON response. The method identifies the source plan using either plan_no or client_plan_id, since the yml marks these two fields as alternatives to each other through alt_required_field. This example uses plan_no, the Aria-assigned numeric identifier for the plan being copied, rather than client_plan_id, the client-defined alternative; only one of the two belongs in a given call, so client_plan_id is left out here. The optional plan_name field gives the newly created plan a name of its own, and the optional new_client_plan_id field gives that new plan its own client-defined identifier, distinct from the identifier on the source plan.

Sample response

{
  "error_code": 0,
  "error_msg": "OK",
  "plan_no": 20599
}

An error_code value of zero, together with an error_msg value of "OK", indicates that Aria copied the plan successfully. The plan_no returned here is the Aria-assigned identifier for the newly created plan, not the source plan supplied in the call. This example leaves out the optional client_plan_id argument, since plan_no was chosen as the identifier for the source plan, and it does not attempt to show a failure response.

TOP
  • Was this article helpful?