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.
$param = array( "apiKey"=>"abcd123", "password"=>"123", "module"=>"employee", "action"=>"get", "id"=>"1" );
{"id":"1", "group_id":"1", "user_type":"employee", "title":"Employee", "fname":"Nobal", "lname":"Ghosle", "email":"ng@alphainfolab.com", "password":"202cb962ac59075b964b07152d234b70", "status":"Active", }
Magnet follows the REST model of exposing resources as URLs. For example
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).
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 |
$param = array("apiKey"=>"abcd123", "password"=>"123", "module"=>"coupon", "action"=>"add" , "title"=>"coupon-title", "name"=>"A- coupon", "s_id"=>"1", "ca_id"=>"1", "l_id"=>"1", "type"=>"deal", "status"=>"Active", "link"=> "www.google.com" );
Response :{ "status":"Success", "message":"Added Successfully", "inserted_id":2076 }
Request : update$param = array("apiKey"=>"abcd123", "password"=>"123","module"=>"coupon", "action"=>"update" , "title"=>"coupon-title", "name"=>"A- coupon", "s_id"=>"1", "ca_id"=>"1", "l_id"=>"1", "type"=>"deal", "status"=>"Active", "link"=>"www.google.com", "id"=>2076 );
Response:{ "status":"Success", "message":"Updated Successfully" }
Request : get$param = array( "apiKey"=>"abcd123", "password"=>"123" "module"=>"coupon", "action"=>"get" , "id"=>603 );
Response :{ "c_id":"603", "owner_id":"3", "owner_type":"admin", "s_id":"0,44,0", "ca_id":"0,84,83,0", "l_id":"0,34,0", "title":"Men's Casual Shoes Starts at Rs. 499", "name":"Men's Casual Shoes Starts at Rs. 499", "slug":"mens-casual-shoes-starts-at-rs.-299", "meta_title":"%%name%%", "meta_key":"%%keywords%%", "meta_desc":"%%description%%", "small_desc":"", "description":"Men's Casual Shoes at Yepme. Categories : Men’s Footwear Brands : Yepme Product : Shoes Validity : Limited Period ", "type":"deal", "featured":"1", "featured_image":null,"image":"shoes1431932214.jpg", "status":"Active", }
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 |
$param = array( "module"=>"coupon", "action"=>"add" , "title"=>"coupon-2", "name"=>"b- coupon", "s_id"=>"1", "ca_id"=>"1", "l_id"=>"1", "type"=>"deal", "status"=>"Active", "link"=> "www.google.com", "advapiKey"=>"abcd123", "advpassword"=>"123" , );
Response :$param = array( "module"=>"coupon", "action"=>"update" , "title"=>"coupon-api", "name"=>"API- coupon", "s_id"=>"1", "ca_id"=>"1", "l_id"=>"1", "type"=>"deal", "status"=>"Active", "link"=> "www.google.com", "advapiKey"=>"abcd123", "advpassword"=>"123" , "id"=>2077 ); { "status":"Success", "message":"Added Successfully", "inserted_id":2077 }
Request : update$param = array( "module"=>"coupon", "action"=>"update" , "title"=>"coupon-api", "name"=>"API- coupon", "s_id"=>"1", "ca_id"=>"1", "l_id"=>"1", "type"=>"deal", "status"=>"Active", "link"=> "www.google.com", "advapiKey"=>"abcd123", "advpassword"=>"123" , "id"=>2077 );
Response:{ "status":"Success", "message":"Updated Successfully " }