/moservices/rest/api/ipass/{COMPANY_ID}/mo/costcenter
Add a Cost Center.
Parameter | Value | Description |
---|---|---|
COMPANY_ID | Your companyId can be found in the Open Mobile Portal. | Mandatory |
action | createCostCenter | Mandatory |
User-Agent | apiuser | Mandatory. This helps us route your API call appropriately. |
<costcenter> <name>Finance Department</name> <costId>Finance</costId> <assignedCount /> <childCompany /> </costcenter>
Parameter | Description |
---|---|
name | Mandatory |
costId | Mandatory |
childCompany | Optional. The ID of the child companies (if Cost Center is enabled with the support of Child Companies). |
In this example, a Cost Center named “Finance Department” will be created under the Acme company (ID 987654).
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=createCostCenter&User-Agent=apiuser"
String reportURI = "/moservices/rest/api/ipass/" + companyId + "/mo/costcenter?action=createCostCenter&User-Agent=apiuser"; HttpPost reportPost = new HttpPost(BASE_URL + reportURI); StringBuffer result = new StringBuffer(); result.append("<costcenter>\n"); result.append("<name>").append(costCenterName).append("</name>\n"); result.append("<costId>").append(costCenterId).append("</costId>\n"); result.append("<assignedCount>").append("").append("</assignedCount>\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