API Documentation

Magnet provides HTTP based API. The HTTP protocol's rules are followed thereby enabling simple HTTP client tools like "curl" to be used. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. We use built-in HTTP features, like HTTP authentication and HTTP verbs, which can be understood by off-the-shelf HTTP clients.

The Magnet API allows developers to integrate its database into their applications, enabling their users to access thousands of coupons and discounts.

Magnet Magnet uses HTTP BASIC Auth for authenticating the API calls. The API key could be got from 'Your API Keys' page under integration tab in the web client console. You can manage your API keys from your account. Your API keys carry many privileges, so be sure to keep them secret.

  1. Login to your Magnet software.
  2. Go to My profile >> API Acces
  3. If api filed is blank so click to generate api key and generate your api key.
Your code like: Genereated response:
Admin Advertiser:

Magnet follows the REST model of exposing resources as URLs. For example

  1. Request
  2. Response
  3. Sample Code

All operations specific to that resource are exposed. The methods accept the input params as an array. You could also pass the environment configuration specific to that request as an additional parameter.

The response is in JSON format. JSON will be returned in all responses from the API, including errors (though if you're using API bindings, we will convert the response to the appropriate language-specific object).

Action
  1. get : You can retrieve data from using the get method
  2. add : You can add data from using the add method
  3. update : You can modify your added data from update method
Parameters :
  1. message : A descriptive information about the action happened
  2. status : this is show what is the status of your message like, error, warning, success etc.
  3. inserted_id : If we perform an add action,so we can get the ID of the last inserted record immediately.
Admin
Module get* add* update* More Parameter
store id name, status s_id name, status
category id name, status ca_id name, status
location id name, status l_id name, status
coupon id title, name, s_id, ca_id, l_id, type, status, link id title, name, s_id, ca_id, l_id, type { deal | copycode | sign_in}, status, link
deal deal_id text, status, title, start_at , expire_at { start_at and expire_at Format example : 2015-06-23 12:45:46 } deal_id text, status, title, start_at , expire_at { start_at and expire_at Format example : 2015-06-23 12:45:46 }
custom_page id name, title, fb_thumbnail, status, visibility { public | private } id name, title, fb_thumbnail, status, visibility { public | private }
banner id name, status, relative_type { home,stores | locate | category | coupon | cms_pages } id name, status, relative_type { home,stores | locate | category | coupon | cms_pages }
group group_id, group_type name, group_type, status group_id, group_type name, group_type, status
employee id,user_type fname, lname, email, password, status, group_id id, user_type fname, lname, email, password, status, group_ids
advertiser id,user_type fname, lname, email, password, status, group_id id, user_type fname, lname, email, password, status, group_ids
client id fname, lname, email, password, status id fname, lname, email, password, status
Module add* update* More Parameter
store name, status s_id name, status
coupon title, name, s_id, ca_id, l_id, type, status, link id title, name, s_id, ca_id, l_id, type, status, link
profile ----- id fname, lname, email, skype