API Documentation

The TenderSoko API allows you to fetch tenders from the TenderSoko platform as either json or embedable html code. Before you can start fetching data from the API, you need to first do the fellowing:

  • Register for API access here.
  • Create an App here.
  • After creating the App, click on it and grab your App token.
  • If this is the first app you are creating, you will receive a 3-day trial API plan.

All Request coming to the TenderSoko API will be verified against the API Token provided in the request. If no token is provided, the API will return
{"status":false,"message":"Missing application or invalid token."}
When you create an app, the app token is also automatically generated and can be found on the app profile.

Currently, the tokens on the TenderSoko API do not have an expiry but if you so with to change the App Token at anytime, click on the Refresh Token.
To fetch valid, closing or today tenders from the API, make a request using the url below:
GET

  • {type} - Type of tenders you want to get. Type can be valid, today or closing.
  • {your-app-token} - This is the token you get after following the guide under
If your request was successful, you will get a response from the API similar to :
              
                {
                  "status":"OK",
                  "tenders":[
                    {
                      "id":209,
                      "tenderID":11427,
                      "companyID":200,
                      "company":"KENYA CIVIL AVIATION AUTHORITY",
                      "companyLogo":"https:\/\/www.tendersoko.com\/images\/companies\/200.jpg",
                      "title":"PROVISION OF CALIBRATION SERVICES FOR NAVIGATIONAL AIDS. SURVEILLANCE SYSTEMS AND VALIDATION OF PROCEDURE IN KENYA AIRSPACE",
                      "closing_date":"2018-12-04",
                      "added_datetime":"2018-10-31",
                      "sector":"Public",
                      "sectorID":3,
                      "category":"Multiple",
                      "categoryID":1
                    }
                  ],
                  "tType":"valid",
                  "number":1
                }
              
            
You can get categories, sectors and companies from the TenderSoko API that you can then pass as a url parameter to filter the tender data you get from the API. Please note that categories, sectors and companies you will get from the API are only those currently having valid tenders on the platform.
GET

  • {type} - Type of data you want to get. Type can be companies, categories or sectors.
  • {your-app-token} - This is the token you get after following the guide under
The json below shows a response you might get from a request from the API for sectors :
              
                  {
                    "status":true,
                    "sectors":[
                      {"id":6,"name":"Church"},
                      {"id":4,"name":"Institution"},
                      {"id":2,"name":"NGO"},
                      {"id":5,"name":"Parastatal"},
                      {"id":1,"name":"Private"},
                      {"id":3,"name":"Public"},
                      {"id":7,"name":"Sacco"}
                    ],
                    "number":7
                  }
              
            
You might want to refine the tenders you get from your valid, closing and today tenders. The TenderSoko API allows you to filter data from the API using:
  • Category Append the &category={id} parameter to your API request.
  • Sector Append the & sector={id} parameter to your API request.
  • Company Append the &company={id} parameter to your API request.
  • Start Date Append the &start_date={id} parameter to your API request.
    This allows you to fetch all tenders whose closing date is after this date.
  • End Date Append the &end_date={id} parameter to your API request.
    This allows you to fetch all tenders whose closing date is before this date.
GET

  • {type} - Type of data you want to get. Type can be valid, closing or today.
  • {your-app-token} - This is the token you get after following the guide under
  • {filterType} - Type of filter you want to apply to the request. Type can be category, sector or company.
  • {filterTypeID} - The ID of the filter type you want to apply to your request. Please note this is the ID you get after requesting for filter type as shown in .

NB You can add more than one filter type to your API request i.e
https://api.tendersoko.com/{type}/?token={your-app-token}&category=1&company=200&start_date=2018-11-11

The json below shows a response you might get from a request from the API for sectors :
              
                {
                  "status":"OK",
                  "tenders":[
                    {
                      "id":209,
                      "tenderID":11427,
                      "companyID":200,
                      "company":"KENYA CIVIL AVIATION AUTHORITY",
                      "companyLogo":"https:\/\/www.tendersoko.com\/images\/companies\/200.jpg",
                      "title":"PROVISION OF CALIBRATION SERVICES FOR NAVIGATIONAL AIDS. SURVEILLANCE SYSTEMS AND VALIDATION OF PROCEDURE IN KENYA AIRSPACE",
                      "closing_date":"2018-12-04",
                      "added_datetime":"2018-10-31",
                      "sector":"Public",
                      "sectorID":3,
                      "category":"Multiple",
                      "categoryID":1
                    }
                  ],
                  "tType":"valid",
                  "number":1
                }
              
            
To get the tender advert, make a request to the API as shown
GET

  • {id} - The tender id you got in the tender body from the response you get from .
  • {your-app-token} - This is the token you get after following the guide under
The json below shows a response you might get from a request from the API for tender advert :
              
                {
                  "status":true,
                  "tender":{
                    "id":209,
                    "ts_tender_id":11427,
                    "companyID":200,
                    "company":"KENYA CIVIL AVIATION AUTHORITY",
                    "companyLogo":"https:\/\/www.tendersoko.com\/images\/companies\/200.jpg",
                    "title":"PROVISION OF CALIBRATION SERVICES FOR NAVIGATIONAL AIDS. SURVEILLANCE SYSTEMS AND VALIDATION OF PROCEDURE IN KENYA AIRSPACE",
                    "closing_date":"2018-12-04",
                    "added_datetime":"2018-10-31",
                    "sector":"Public",
                    "sectorID":3,
                    "category":"Multiple",
                    "categoryID":1,
                    "type":"Invitation toTender",
                    "tenderTypeID":1,
                    "description":"PGh0bWwgeG1sbnM6dj0idXJuOnNjaGVtYXMtbWljcm9zb2Z0LWNvbTp2b..",
                    "downloadLink":"http:\/\/127.0.0.1:8000\/tenders\/adverts\/PROVISION%20OF%20CALIBRATION%20SERVICES%20FOR%20NAVIGATIONAL%20AIDS.%20SURVEILLANCE%20SYSTEMS%20AND%20VALIDATION%20OF%20PROCEDURE%20IN%20KENYA%20AIRSPACE.pdf",
                    "documents":[
                      {
                        "title":"154142760339024489.pdf",
                        "download":"http:\/\/127.0.0.1:8000\/tenders\/documents\/154142760339024489.pdf"
                      }
                    ],
                    "doc_count":1,
                    "date":{
                      "date":"2018-11-19",
                      "dateTime":1542649090
                    }
                  }
                }
              
            

  • The description property of the tender object is base64encoded, so remember to base64decode to get the HTML for the tender advert.
  • The downloadLink property is a link to the PDF version of the tender advert
  • The documents property is an array containing any tender documents for the tender.