Steelment API endpoinst Documentation 
================================

### [Active service link](http://steelmint.temp.coreaura.net)

## Responses
General responce type

    {
        "data#": {
            
        },
        "status#" : 13,
        "message#" : "custom"
    }

### Responce status code

#### Header code: 

[WIP]=> work in progress
* 403 => Unauthorized access token
* 206 => partial input
* 200 = OK
* 400 => Bad request, you have requested blank, go to the message for detail. 

#### Status code: 

* 0 => "Error"
* 1 => "Success"
* 1001 => Unauthorized action. Token access denied
* 1002 => Unauthorized action. Please request with token
* 1003 => Unauthorized action. Email not verified
* 1004 => You are already loggedIn from some other device
* 1011 => Unauthorized action. please enter username and password
* 1021 => username already exists
* 1022 => email already exists
* 1023 => user verification email sending error
* 1024 => user creation unexpected error
* 1025 => pending for email verification
* 1026 => Enter email in forget_password
* 1027 => resend email, Already verified
* 1028 => resend email, email not found in out database
* 1029 => resend email, Unexpected error
* 1030 => 
* 1031 => 
* 1032 => please enter old password for new password (update entry)
* 1033 => email exists (update entry)
* 1034 => phone number exists (update entry)
* 1035 => field data empty (update entry)
* 1036 => old password doesn't match with exiting password (update entry)
* 1037 => invalid update request (update entry)

* 1041 => token not exists in our database
* 1042 => token exists but updating user table activation table problem
* 1043 => internal error, token exists more than once
* 1044 => 
* 1045 => 
* 1051 => Internal database error
* 1060 => Not valid method in action route
* 1061 => Required login to set notification
* 1062 => No mobile_notification send
* 1063 => No type param in getcms request
* 1071 => Wordpress not giving data (for getallnews)
* 1081 => Invalid place(for getalllogistics)
* 1091 => Request with item
* 1101 => Tender enquiry, required comment param
* 1110 => Events delegate form failure
For plantbee
* 1201 => Not valid image
* 1202 => Please enter email and phone number or login to post 
* 1203 => lead details is not array, please enter it as array
* 1301 => Paypal payment gateway, payment verification fails
* 1310 => Inapp purchase fails.
* 1311 => CCavenue events purchase but entry unsuccessfull
* 1312 => CCavenue user plan purchase but entry unsuccessfull
* 1313 => CCavenue payment module not found
* 1314 => Paypal events purchase but entry unsuccessfull
* 1315 => Paypal user plan purchase but entry unsuccessfull
* 1316 => Paypal payment module not found
* 1317 => Payment amount not same
* 1318 => inapp user plan purchase but entry unsuccessfull
* 1319 => inapp payment module not found
* 1330 => Order id not same



API endpoints
==============

User Module
========

#### a. API Format notation

* API endpoint
    - Request type
        + Request 
            * parameter1 
            * parameter2
        + Response 
            * HTTP header status 
            
                    {
                    response example
                    }

#### API endpoints

* /user/refresh_token - refresh token  Generation
    - Post
        1. + Request 
                * username
                * password
            + Response 
                * 200 
                   ```
                   {
                    "status#": "1",
                    "data#": {
                      "refreshToken": "6zfSxcEArQvO4d2fbj7KeHwfbubVm9Ua"
                     }
                   }
                   ```

                * 403 
                   ```
                   {
                     "status#": "1001",
                     "message#": "Unauthorized action. Token access denied"
                   }
                   ```

                * default
                   ```
                   {
                   "status#": "default code",
                   "message#" : "message"
                   }
                   ```
                    ```
                        {
                        "status#" : "500"
                        }
                    ```
* /user/token - token Generation
    - Post 
        + Request 
            * refreshToken
        + Response 
            * 200 
            ```
            {
                 "status#": "1",
                 "data#": {
                   "token": "MyKtqfGk6lptUfUq5ZjxCf7KhnEwoSoK"
                 }
            }
            ```

            * 403
            ```
            {
              "status#": "1001",
              "message#": "Unauthorized action. Token access denied"
            }
            ```
            * default
                ```
                {
                 "status#": "default code",
                 "message#" : "Error message"
                }
                ```
                ```
                {
                  "status#": "500"
                }
                ```

* /user/forget_password
    - Post
        + Request 
            * email
        + Response 
            * 200
        ```
        {
        "message#": "Password generation email is send to your email id"
        }
        ```

            * default
            ```
            {
            "Error#": "default code",
            "code#" : "Error_code_value"
            }
            ```

* /user - get user's info
    - Get (get user's info)
        + Request 
            * token
        + Response
            * 200
                ```
                {
                User's information
                }
                ```
            * 403 
                ```
                {
                "Error#" : "Unauthorized request",
                "code#" : "Error_code_value"
                }
                ```
            * default
                ```
                {
                "Error#": "default code",
                "code#" : "Error_code_value"
                }
                ```
    - Post (create new user) (Verified by Varun)
        + Request
            * password
            * email
            * company
            * name
            * phoneno
            * country
            * state (optional)
        
    - Patch (Update user)
        + Request 
            * token (compulsory)
            * name (Update name)
            * email (Update email)
            * phoneno (Update phone number)
            * password (Update password)
            * old_password (Old password in case of change password only)
            * company (Update company name)
            * company_type (Update company type): will be id of company type returned from `/user/listing` api
            * product_of_interest (Array of string having name of product of interest)
            * designation (Update designation): id of designation from api `/user/listing`
            * department (Update department): id of department from api `/user/department`
            * address (Update address)
            * state (Update state): id of department from api `/user/countrystate`
            * city (Update city): id of department from api `/user/countrystate`
            * pin_code (Update pin/postal code)
            * website (Update website)
        
 
* /user/logout
    - Post (For logout user from database so that he can login from another mobile)
        1. 
            + Request 
                - username 
                - password 
            + Response 
            
        2. 
            + Request
                - token 
            + Response
            
#### b.  Get extra listings like company_type, department, designation and product_type

Request type: __GET__    
Link: `/user/listing`


News Module
=======

Here you can get all news for the steelmint from the wordpress news blog. 
There are various categories and subcategories of news. You can get all of them or get only news of that category. 

### a. Get all category 
To get all category of news you have to request a `GET` to following link. 

* Request type: GET
* link: `/v2/action/news/category`
* Sample output: 
```json
[
  {
    "cat_id": "2",
    "cat_name": "RAW MATERIAL",
    "sub_cat": [
      {
        "cat_id": "5",
        "cat_name": "COAL"
      },
      {
        "cat_id": "4",
        "cat_name": "IRON ORE"
      }
    ]
  },
  {
    "cat_id": "3",
    "cat_name": "SEMI FINISHED",
    "sub_cat": [
      {
        "cat_id": "7",
        "cat_name": "BILLET"
      },
      {
        "cat_id": "6",
        "cat_name": "INGOT"
      }
    ]
  },
  {
    "cat_id": "1",
    "cat_name": "Uncategorized",
    "sub_cat": []
  }
]
```

### b. Get list of countries with their states

Link: `/user/countrystate`   
Request Type: `get`

### c. Get listings of company_type, department, designation, and product_type

Link: `/user/listing`   
Request Type: `get`

### d. Get all news 
We can also get a list of all news as requested in params. Request will be in post. 

Link: `/v2/action/news`

__PARAMS__:

* `filter`: It is the filter according to which you want news. In this param you have to send array having following things
    * for generic search use `<search item in string>`. Do remember, you have to send array at time of generic search
    * Array would be like this

        {
        "country": "<country>", // you can also use multiple country as CSV format like, asia,mena...,etc.
        "mostread": "yes",
        }
* `category`: Send the news according to categories. You can get all categories by above `Get all category` api for news.  
* `start`: set the start number of news
* `number`: News limit/count. this param is used to set how many number of news you want in this request.
* `postfrom` : get post from editied or new news
   * `edit:<post-id>` Through this you can get all edited post only from post-id
   * `new:<post-id>` Through this you can get all new news from post-id. 

### e. Get news by idGet news after certain news id 
You can also get news after only that set of which are added after that news ID. Through this you can get only updated news. 
We can also get news by specific ID. Request will be in post. 

Link: `/v2/action/news/{news_id}`   
Request type: __POST__

### f. Get news filters 

Link: `/v2/action/news/filters`   
Request type: __GET__

Tenders Module
==========

### a. Get all tenders
We can get a list of all tenders with some information in it. We can also filter this list according to various filters. You can specify all filters to `filter` params, I am sharing some information about data format send to this, 

Request type : `post`
__PARAMS__:
 
* `filter`: get tenders related to that filter category mentioned on this. Remember, you can use only one filter at a time.
    * category:`<category_type>`
        Like `category:all` , `category:RAW MATERIAL` , `category:SEMI FINISHED` , etc.
        This is used to filter tenders according to category 
    * search: <generic search>
        This is used for generic search
    * date: <date>
        This is used to filter ender to show tenders after that date only
    * state_name: <name of state>
    * Country: <country name>
* `start`:  want start page of post which is generally `0`
* `number`: number of post wanted, this is generally `50` for mobile case.
* `postfrom`: get post from editied or new tenders
    * `edit:<post-id>` Through this you can get all edited post only from post-id
    * `new:<post-id>` Through this you can get all new tenders from post-id
* `arr_filter`: You can send array for this having following key values.
    * `islive:Live`
    * `item:<item_name>` Through this you can apply sub category filters to tenders
    * `lead_type:<type of lead>` Through this you can filter according to lead type (Buy/Sell/Rent)
    * `offer_type:<offer type>` Through this you can filter according to offer (TENDER/AUCTION)
    * `floor_price:<is contain floor price>` This filter currently not know to us.
    * `opening_date:<Date of opening>` This filter can filter all tenders having that opening data
    * `closing_date:<Date of closing` This filter can filter all tenders having that closing data
    * `country_name:<country name` This filter can filter tenders accroding to country
    * `state_name:<name of state>` This filter can filter according to state, please note that this only will work when country will be India
    * `date:<due date filter>`
        * `Expiring in 5 days`
        * `Expiring in 10 days`
        * `Expiring in 15 days`
    * `company_name:<company_name>`

__`arr_filter` type__
* country_name
* state_name
* lead_type
    * buy
    * sell
    * service
* offer_type
    * TENDER
    * AUCTION
* state
* islive
    * live 
    * expire
* due date
    * Expiring in 5 days
    * Expiring in 10 days
    * Expiring in 15 days

### b. Apply filters to tender by single filters.
You can request with `filter` param to request with one filters. 

### c. Get all filter list for tenders

Link: `/v2/action/tenders/filters`   
Request type: __GET__
 
### d. Get all category list for tenders

Link: `/v2/action/tenders/category`   
Request type: __GET__

### e. Get tender from tender id 

Link: `/v2/action/tenders/{tender-id}`   
Request type: __POST__

### f. Tender enquiry form

Link: `/v2/action/tenders/enquiry`   
Request Type: __POST__
Params:
* token
* tender_id (compulsory)
* name (compulsory)
* email (compulsory)
* mobile (compulsory)
* country_id (compulsory)
* comments (compulsory)
* company (Optional)
* state_id (Optional)
* city_id (Optional)

Prices Module
=========

Get price list and graph of the price

### a. List all category of prices

Link: `/v3/action/price/category`   
Request type: __GET__

### b. Prices getall prices/logistics

Link: `/v3/action/price`   
Request type: __POST__

__PARAMS__:
* token
* category
* tab
* trade_type

__Example__

1. If you want all Raw materials 
    * category: RAW MATERIAL
        Here category comes from filter 
2. If want tabs data like for Odisha
    * tab: Odisha
    
### c. New price get graph 

Link: `/v3/action/price/{graph_id}`    
Request type: __POST__

__PARAMS__:
* token
* f_price_column (Got in price details)
* assesment (Got in price details)
    


Events Module
================

### a. List all events
You can get all events from here.

Link: `/v3/action/events`   
Request type: __POST__

###  b. Event by ID
You can also get events details by id

Link: `/v3/action/events/{event_ID}`   
Request type: __POST__

__PARAMS__
* token (Optional)

### c. List participants 
By default you get all pariticipants in event get by ID by to apply filter you can use this API,

Link: `/v3/action/events/participants/{event_ID}`
Request type: __POST__

__PARAMS__
* token (Optional)
* filters: Dictionary having key as filter names as filters['company'] = 'company1;company2'
    * company
    * profile
    * designation
    * country 
    
    Note:: Above filters are not static, they should be get from `/v3/action/events/{event_id}/filters` 

### d. List all filters for participants 

Link: `/v3/action/events/filters/{event_ID}`  
Request type: __POST__

__PARAMS__
* token (Optional)

### e. Get price of any event ID
You can also price of event for delegates   

Link: `/v3/action/events/delegate_price/{event_ID}`   
Request type: __GET__    
Info: get number of delegated by minus this string ` Delegates` (do remember space).

__PARAMS__
* token (Optional)

### f. Get total price include all taxes for payment gateway of any event ID

Link: `/v3/action/events/delegate_price/{event_ID}`   
Request type: __POST__ 

__PARAMS__

* token
* delegate_number: Number of delegates
* type: early_bird/standard/onspot

### g. Delegate form fill 

Link: `/v3/action/events/delegate_registration/{event_ID}`   
Request type: RAW (Json data) 

__PARAMS__

* token (optional)
* type (Compulsory)
* delegates[]: This will be form of array, use multiple delegate array to post for multiple delegate 
    * name (Compulsory)
    * email (Compulsory)
    * company (Compulsory)
    * phoneno (Compulsory)
    * city (Compulsory) You can send '' value in this; send id
    * state (Compulsory) You can send '' value in this; send id
    * other_city (Compulsory) You can send '' value in this; send id
    * country (Compulsory) ; send id

### h. Delegates contact us 

Link: `/v3/action/events/delegate/contactus/{event_ID}`   
Request type: __POST__ 

* token (Optional)
* name (Compulsory)
* email (Compulsory)
* phoneno (Compulsory)
* company (Compulsory)
* country_name (Compulsory)


Get all faqs 
===============

You can get all faqs from the following link

Link: `/v2/action/faqs`   
Request type: __GET__

Get terms and conditions
============================

You can get all terms and conditions from following endpoints, please also remember that responses are in HTML, so please html renderer to show data. 

Link: `v2/action/termsandconditions`   
Request type: __GET__
    
Plantbee Module
============
Get post of plants buy and sell. Plantbee having idea to implement a add site for plants, where user can post add and also see others posts of plants. 

### a. List all post
To get list of all post use this api 

Link: '/v1/plantbee/getallposts'   
Request type: __POST__

__PARAMS__:
* `zone`:
    Get posts by country filter, current country filters are according to zone like, Central India, West India, South India, East India, etc, so please send that and you will get the filter
* `plant_type`: 
    Get posts by plant type. Do remember its by plant type code containing array. So you need to send `plant_type["20140806094137-182733724606HvOR4eud", "20140806082846-1827337246Ddt72xk0d3"]`
* `most_viewed`: default value `false`
    - true: if you want to filter post according to most views
    - false
* `on_rent`: default value `false`
    - true, if you want to filter on rent posts only 
    - false, if you want to filter which are not on rent
* `have_images`: default value `false`
    - true, if you want to filter posts that have images 
    - false, if you want to filter posts that don't have images 
* `lead_type`
    - buy
    - sell
* search: 
    Generic search, you can also used to send tags in search, for that you just have to send `tag:<tag_id1>;<tag_id2>`
* `page_number`:
    Which page number you want to list. Page number starts from 0 to n. 
* `postfrom`:
    To get post from this plant post id. Like `postfrom: 338` will send only those leads whos id is greater than 338
    
### b. Generate lead id impression 
To generate lead id impression. Mobile will hit this service with lead id whenever any user see the perticualr post. Used to analytics.

Link: `/v1/plantbee/leadimpression/{lead_id}`    
Request type: __GET__

Note: If you are creating request through getleaddetails, then you don't need to hit this service. 

### c. List all plant type 

Link: `/v1/plantbee/plantype`   
Request type: __GET__

### d. To get all buy plant type 

Link: `/v1/plantbee/plantype/buy`   
Request type: __GET__

### e. To get all sell plan type

Link: `/v1/plantbee/plantype/sell`   
Request type: __GET__

### f. Get details of leads

Link: `/v1/plantbee/plantype/getleaddetail`   
Request type: __POST__

### g. Get all tags 

Link: `/v1/plantbee/getalltags`    
Request type: __POST__  

__PARAMS__
* lead_id:
    Lead id get in getallposts

### h. Enquiry for any post 

Link: `/v1/plantbee/enquiry`   
Request type: __POST__

__PARAMS__
    * token
    * lead_id (compulsory)
    * name (compulsory)
    * email (compulsory)
    * mobile (compulsory)
    * country_id (compulsory)
    * comments (compulsory)
    * company (Optional)
    * state_id (Optional)
    * city_id (Optional)
    
### i. Get all filters 

Link: `/v1/plantbee/searchfilers`   
Request type: __GET__

### j. Get home page images 

Link: `/v1/plantbee/homepageimage`   
Request type: __GET__

### k. Post your offers 

Link: `/v1/plantbee/createpost`    
Request type: __POST__

**Params**:
* token: used for user login (Optional)
* category: (Compulsory)
    - buy: for category buy 
    - sell: for category sell
* description: Description of the product (Compulsory)
* email: If not send token, then send this 
* phone: if not send token, then send this
* name: if not send token, then send this
* company: if not send token, then send this
* images: Image files, you can also send multiple images to this parameter (Optional)
* docs: document files, you can also send multiple files to this parameter (Optional)
* plant_type: plant type code from the selected by user
* country: country code selected by user 
* state: state code selected by user (Optional)
* city: city code selected by user (Optional)
* lead_details: array of following things 
    - name: 
    - type
        + machine: For machine
        + misc: Miscellaneous 
        + land: for land and buildings
    - quantity (Only if type is machine, misc)
    - number (Only if type is machine, misc)
    - capacity (Only if type is machine, misc)
    - make (Only if type is machine, misc)
    - year (Only if type is machine, misc)
    - area (Only if type is land/building)
    - location (Only if type is land/building)
    - remark (Optional)
  
__RETURN__
* otp_id

Extra APIS
==========

All below request are in post, so not defining.
Note:
    * If user is login send `token`
    * If user is not login don't have to send `token`

### Resend email: 
* /v1/action/resendemail - for resending verification email for account activation 
    - Request
        + Post 
            * email 
    - Response 
        + 200
            {
            "status#": "1",
            "message#": "email send"
            }
        + default 
            {
            "status#": "1023",
            "message#": "email sending failed."
            }

### Get CMS 
* /v1/action/getcms
    - Request 
        + type: aboutus, terms, contactus, enquiry, feedback
    - Response 
        + 200
            ```
            {
              "status#": "1",
              "data#": "\n\t\t\t\t\t<img width=\"290px\" src=\"img/steelmint_slidenew1.jpg\"/><br/>\n\t\t\t\t\t<img width=\"290px\" src=\"img/steelmint_slidenew2.jpg\"/><br/>\n\t\t\t\t\t<img width=\"290px\" src=\"img/steelmint_newslide3.jpg\"/><br/> <br/>\n\t\t\t\t\t<p>Thanks for choosing us as your information provider. The new SteelMint App is the best way to access data, news & information on Iron & Steel markets across the world on your mobile! (And we are constantly working to improve it)</p>\n\t\t\t\t\t\n\t\t\t\t\tStay ahead in the completion with instant notifications, live price updates and important news alerts on more than 30 Steel products.<br/>\n\t\t\t\t\t1. Steel News - Latest news & analysis from Iron & Steel industry<br/>\n\t\t\t\t\t2. Steel Prices - Live global/domestic Price Updates<br/>\n\t\t\t\t\t3. Tenders - Current Steel Tenders on your finger tips<br/>\n\t\t\t\t\t4. Events - Updates about Global Steel events<br/>\n\t\t\t\t\t5. Plant & Machinery - Updates from Plantbee.com<br/>\n\t\t\t\t\t6. Logistics - Iron ore & Coal Vessel Data<br/><br/>\n\t\t\t\t\tAccess everything on the move.<br/>\n\t\t\t\t\tSimplifying Steel Trade!<br/>\n\t\t\t\t"
            }
            ```
            
        2. enquiry (Contactus)
        - Request 
            - name
            - lastname
            - email 
            - phoneno
            - interest
            - address
        - Respose 
            ```
            {
                "status#" : "1",
                "message#" : "message"
            }
            ```
            
### feedback
    - Request 
        - name
        - message
    - response 
        ```
        {
        "status#" : "1" ,
        "message#" : "message"
        }
        ```
            

Payment Gateway for event delegate registration 
==============================================

### CCAVENUE 

#### 1. Hit before payment gateway 

You have to hit delegate form registration and you will get following output. 

```
{{
   "status#": "1",
   "data#": {
     "page": "http://www.steelmint.com/api/public/v3/action/events/payment?reglogs_id=90&amt=25132&orderid=EVENTS1-6979",
     "bill_no": "EVENTS1-6979",
     "payment_gateway": "CCAVENUE",
     "payment_detail": {
       "1 Delegates": 21950,
       "Service Tax 14%": 3073,
       "Swachh Bharat Cess 0.5%": 109.75,
       "Total": 25132.75
     }
   }
 }
```

#### 2. Hit after payment gateway: 

You have to use `page` redirect param in ccavnue and it will automatically redirect to us. Not need to hit after payment gateway thing.

### Paypal 

#### 1. Hit before payment

You have to hit delegate form registration and you will get following output. 

```
{
  "status#": "1",
  "data#": {
    "page": "http://www.steelmint.com/pay/newCheckOut.php?reglogs_id=89&amt=400&orderid=EVENTS1-6978&uid=60016&pymtSrc=online_reg&productPurchased=&crency=USD&page_name=Events",
    "bill_no": "EVENTS1-6978",
    "payment_gateway": "PAYPAL",
    "payment_detail": {
      "1 Delegates": 400,
      "Total": 400
    }
  }
}
```

#### 2. Hit after payment successful

Link: `/v3/action/events/payment`    
Request type: __POST__    

__PARAMS__    
* order_id: Provided by our server at time of initiating payment
* payment_gateway: paypal
* token
* sale_id: Sale id by paypal


If payment is successfull, you will get 

```
{
  "status#": "1",
  "message": "Payment successful"
}
```

Subscription plan 
==================

### Get subscription plan 

Link: `/v2/action/getsubscriptionplan`    
Request type: __POST__    

__PARAMS__
* token (Optional)

### Hit service before payment to log things

Link: `/v2/action/subscription/beforeplan`    
Request type: __POST__    

#### 1. INAPP (IPHONE)

__PARAMS__
* token (Compulsory)
* plancode (Compulsory): plancode like Free Trail/VAS-G/VAS-P+XLS/MOBILEAPP
* price
* currency INR/USD, etc. 
* iphone: true

__RESPONSE__

```
{
  "status#": "1",
  "data#": {
    "order_id": "SM1-6980",
    "amount": "202"
  }
}
```

#### 2. Paypal (Android)

__PARAMS__
* token
* plancode

__RESPONSE__

```
{
  "status#": "1",
  "data#": {
    "currency": "USD",
    "order_id": "SM1-6981",
    "amount": "190",
    "payment_gateway": "paypal",
    "pymtredirectURL": "http://www.steelmint.com/paypal/payment.php"
  }
}
```

#### 3. CCAVENUE (Android)

__PARAMS__
* token
* plancode

__RESPONSE__

```
{
  "status#": "1",
  "data#": {
    "currency": "INR",
    "order_id": "SM1-6982",
    "amount": "9990",
    "payment_gateway": "ccavenue",
    "pymtredirectURL": "http://www.steelmint.com/pay/newCheckOut.php"
  }
}
```

### Hit service after payment, to update server side logic accordingly 

Link: `/v2/action/subscription/afterplan`    
Request type: __POST__    

#### 1. INAPP (Iphone)

__PARAMS__
* token :(Compulsory)
* order_id :(Compulsory) order id created at step beforeplan calling
* payment_detail :(Compulsory) Array/dictionary of details send by payment gateway, invoice in case of apple in app purchase
* status :(Compulsory) Status send by payment gaetway (success/failure/cancel)

__RESPONSE__

```
{
  "status#": "1",
  "message": "Payment successful"
}
```

#### 2. PAYPAL (Android)

__PARAMS__
* token :(Compulsory)
* order_id :(Compulsory) order id created at step beforeplan calling
* payment_detail :(Compulsory) Array/dictionary of details send by payment gateway, invoice in case of apple in app purchase
* status :(Compulsory) Status send by payment gaetway (success/failure/cancel)

__RESPONSE__

```
{
  "status#": "1",
  "message": "Payment successful"
}
```

Notification:
============

### Set notification for mobile application 

Link: `/v2/notification/register`    
Request type: __POST__    

__PARAMS__
* device (Compulsory): ios/android
* device_id (Compulsory): device ID
* token (Optional): For authentication 

Do remember to hit this api before login and also after login so that we can update user_id also from authentication.

### De-register user for notification 

Link: `/v2/notification/deregister`    
Request type: __POST__    

__PARAMS__    
* device (Compulsory): ios/android
* device_id (Compulsory): device ID
* token (Compulsory): For authentication 

Note: Only user with authentication will de-register

OTP
===

### OTP verification 

Link: `/v2/otp/verify`
Request type: __POST__    

__PARAMS__
* id
* otp



Project Understandings
======================

### 1. Route file: 
`app\Http\routes.php` file contains the all routes and calling respective function co-relation. This files basically used to attach URL to call a Controller's function.
 
### 2. News controller 
`app\Http\Controllers\NewController` file contains all main function related to news module, it can further call custom models for any data and sometimes have internal function of models also. 

* function `getfilters`: Used to get list of filters in news module. 
* function `getcategory`: Used to get list of category for news
* function `getnewsByid`: Get new details by ID
* function `getallnews`: Get list of all news
* function `query_result`: Private internal function used to query wordpress and return its output after processing in array. 

### 3. Notification controller
`app\Http\Controllers\notificationController.php` file contains controller class handle to various notification requests. 

### 4. Payment Controller
`app\Http\Controllers\PaymentController.php`

### 5. Plantbee Controller
`app\Http\Controllers\PostController.php`

### 6. Tenders Controller 
`app\Http\Controllers\TendersController.php`

### 7. Price Controller 
`app\Http\Controllers\PriceController.php`

### 8. User Controller 
`app\Http\Controllers\UserController.php`

### 9. Token Controller for token generation 
`app\Http\Controllers\TokenController.php`

