Search

MachPanel Knowledgebase

INFO:Getting Started with MachPanel REST API

Rehan Waseem
MachPanel

Summary

This article provides information about getting started with MachPanel REST API.

Applies To

This article applies to MachPanel Version v6 and above.

Prerequisites

REST API must be configured as per details on article below:

https://kb.machsol.com/Knowledgebase/55650/MachPanel-REST-API-Configuration

Content
  • Getting List of Customers
    • Getting list of Customer under a reseller using Provider Credentials
  • Creating a new Customer
    • Subscribing Exchange Service with Addon to Customer
  • Creating a new Reseller
    • Subscribing Exchange Service as Reseller​
Getting List of Customers

Browse new website and as you will see as shown below (i.e. Control Panel REST API).

To get the list of all customers you can perform below steps

  • Click List Operations in customers Tab, then click Get Customer operation under this tab as shown below:

  • Here you can get list of all customer (Under Provider and Resellers) and also for any specific reseller.
  • You can specify page and pagesize to narrow your search as shown below (if not set by default it will be 1 and 10 respectively) and click "Try it out!" button to get results:

  

  • In "Response Body" you will get packets for details of each customer and at bottom you will get summary of results.
  • Now, if you want to get of List of Customers under any specific reseller, you just need to put Reseller ID in "Impersonate-as-reseller" and click "Try it out!"

  • In "Response Body" you will get packets for details of each customer under the specified reseller and at bottom you will get summary of results.

  ​

Creating a new customer and Subscribe to Service
  • To create new customer under provider or reseller, you can user Post /api/customers operation as shown below:

  • Now, to create a new customer you can click on Example Value and then give the value to create customer. To create this under the Provider, you do not need to give "Impersonate-as-reseller" ID but if you want to create this customer under some reseller, then you need to give "Impersonate-as-reseller" ID.

  • After giving all information required in Example Value, your customer will be created.

  • Customer is created with ID 169, you will need this ID to Subscribe this customer to service i.e., Exchange
Subscribe Customer to Service
Since the customer is already created with ID 169, Now you can use POST /api/subscription operation

  • Clicking on Example Value will give you complete details required for subscribing a service, Since Customer is already created and so we will erase that part from Example Value and will provide below information

Getting Product Id , Payment Group Id & Billing Cycle Id

  • First you need to find the enabled service

  • On clicking try it out, it will return enabled services and their ids i.e., In this we are using Microsoft Exchange id. It is also the Service Type Id that needs to be passed while subscribing service

  • We will pass this id in below:

  • On click try it out, i will return all Microsoft Exchange product with ids, that id you need to pass in Product Id.

  • You can also get Payment Group Id and Billing Cycle from the above details of Products

  ​​

Getting Provision Variables Details

  • ​On the details of Product shown in above images you can check what are provision variables that needs to passed while subscribing service, in below image there are 2 provision variable that needs to be passed. The one is "domainname" and other is "organizationname"

Getting Addons Id

  • You can expand addons and navigate to Get /api/product/{id}/addons, you need to pass the product id which you have find above, here we have used 1035

  • On clicking try it out, it will return all addons associated with this product and you can get its id.

Subscribe Service

Once all details are found you can pass all above found values as show below:

​​

Then you can click "Try it out!" and your customer will be subscribed.

Create Customer Plus Subscribe Service

You can use POST /api/subscription operation, but this time Example Value will be different

  • You can copy whole example value and keep on the data required for customer creation and subscribe service as shown below:

  • After completing all details above you can click "Try it out!" and your customer and his subscription will be created in one go.
Creating a new Reseller and Subscribe to Service
  • To create new Reseller you can use POST /api/resellers operation

  • Now, to create a new Reseller you can click on Example Value and then give the required value to create a reseller.

  • After giving all information required in Example Value, your Reseller will be created.
Subscribe Reseller to Service

To subscribe customer to a service you have to option:

  • Create Reseller and subscribe service separately
  • Create Reseller plus subscribe service at once
Create Customer and Subscribe Service Separately

To create customer you can follow above mentioned steps in "Creating a new Reseller" Section and follow below to subscribe this already created customer to a service:

  • To Subscribe Reseller to a service steps are almost the same as customer, you just need to pass Reseller id instead of Customer ID to subscribe service as shown below:

  • Once done you can click "Try it out!" and your Reseller will be subscribed.
Create Reseller Plus Subscribe Service as Reseller
You can use POST /api/subscription operation, but this time Example Value will be different
  • You can copy whole example value and keep on the data required for Reseller creation and subscribe service as shown below:

  • After completing all details above you can click "Try it out!" and your Reseller and his subscription will be created in one go.
Details
Type: INFO
Level: Intermediate
Last Modified: 2 Years Ago
Last Modified By: rehan_waseem
Rated 5 stars based on 2 votes.
Article has been viewed 1.9K times.
Options
Also In This Category
Tags