Update a Cost Center

Resource URL
/moservices/rest/api/ipass/{COMPANY_ID}/mo/costcenter
HTTP POST

Update a Cost Center's information.

POST Parameters
Parameter Value Description
Company_IDYour companyId can be found in the Open Mobile Portal.Mandatory
action UpdateCostCenter Mandatory
User-AgentapiuserMandatory. This helps us route your API call appropriately.
Sample XML Payload
<costcenter>
   <name>Finance Department</name>
   <costId>Finance</costId>
   <childCompany />
   <id>123456</id>
</costcenter>
Parameter Description
idMandatory. The unique identifier associated with the Cost Center.
name Mandatory. The name of the Cost Center.
costIdMandatory. The ID of the Cost Center.
childCompanyOptional. The ID of the child companies (if Cost Center is enabled with the support of Child Companies).

Examples

In this example, the Cost Center (ID 123456), which is under the Acme Company (ID 987654), is being updated with a new name. The new name will be “Finance UK” and CostCenterID will be “Finance UK”.

cURL:
curl -k --request POST -b tmpCookies.txt -d input.xml -H “Content-Type: text/xml” "https://openmobile.ipass.com/moservices/rest/api/ipass/987654/mo/costcenter?action=updateCostCenter&User-Agent=apiuser"
The input.xml contains the XML Payload.
Java:
String reportURI = "/moservices/rest/api/ipass/" + companyId + "/mo/costcenter?action=updateCostCenter&User-Agent=apiuser";
HttpPost reportPost = new HttpPost(BASE_URL + reportURI);
				
StringBuffer result = new StringBuffer();
result.append("<costcenter>\n");
result.append("<id>").append(id).append("</id>\n");
result.append("<name>").append(costCenterName).append("</name>\n");
result.append("<costId>").append(costCenter).append("</costId>\n");
result.append("<childCompany>").append("").append("</childCompany>\n");
result.append("</costcenter>\n");
		
StringEntity entity = new StringEntity(result, "text/xml", HTTP.DEFAULT_CONTENT_CHARSET);
reportPost.setEntity(entity);

HttpResponse postResponse = httpClient.execute(reportPost);

Go to: REST API Overview > Manage Cost Center

 

©2015 iPass Inc. All rights reserved. Terms of Use