Insert title here
Vikaspedia Data

Vikaspedia Widget

To use this Vikaspedia widget feature, user must provide a link in the anchor tag as below with desired height and width
Its available for all 23 languages portals of http://vikaspedia.in/index/
---- Urls for Widget -- default height(500px) width(400px)--
<a class="vikaspedia-widget" href="http://vikaspedia.in/social-welfare" ></a>
<a class="vikaspedia-widget" href="http://te.vikaspedia.in/agriculture" ></a>


----OR with costomized size ----
<a class="vikaspedia-widget" href="http://vikaspedia.in/social-welfare" style="height:500px; width:400px;" ></a>
<a class="vikaspedia-widget" href="http://te.vikaspedia.in/agriculture" style="height:500px; width:400px;" ></a>	



---- Sctipt required once either in footer or on page of URLs ----
<script type="text/javascript" src="http://data.vikaspedia.in/resources/js/vikaspedia-widget.min.js" ></script>
The link turns into an widget window if the link provided in the anchor tag is a valid link i.e the link must be an existing link in the portal sitemap.
Note: Anchor tags can be one or multiple and script code should be always be added at the end of the anchor tags.
anchor tag: Anchor tag must contain class vikaspedia-widget
href: Must contain a valid Vikaspedia url otherwise widget is not formed
height & width: Height and width specified will be applied to the Vikaspedia widget
script tag: Should be included to convert the anchor tag to Vikaspedia widget

Ways of implementing Vikaspedia widget:


Adding script in footer
  • 1. Add script tag in the footer section
  • 2. Add anchor tag in any page with class = "vikaspedia-widget" and that will be converted into Vikaspedia widget
Adding script in body
  • 1. Add anchor tag in any page with class = "vikaspedia-widget"
  • 2. Add script tag in the body tag of the page below anchor tag
  • 3. Anchor tag is converted into Vikaspedia widget
Adding multiple anchor tags
  • 1. Add script tag in any of the above two ways
  • 2. Add multiple anchor tags in any page with class = "vikaspedia-widget" and they will be converted into Vikaspedia widget

Note: If second way is followed the script tag should be placed below all the anchor tags included.

.

Vikaspedia API

Language Codes
Language Language Code
English en
Hindi hi
Telugu te
Marathi mr
Malayalam ml

Vikaspedia API provides the following functionalities:


Check url existence

Sends the page/folder url to the server and checks the existence of the url before forming widget.


Request
URL http://data.vikaspedia.in/api/getpage/exist?url=http://te.vikaspedia.in/agriculture
Method GET

Request:Parameters
Parameters
urlurl of the page/folder
Response
{"check":1,"url":"http://te.vikaspedia.in/agriculture","error":"","ln":"te"}
Response:Parameters
Parameters
check Returns 0 for invalid url
Returns 1 for valid url
url Contains url sent for existence
error Empty if no error is present, otherwise returns any error occured at the time of request

Get page or folder content

Sends the page url to the server and gets the page/folder content once the path existence check is completed.


Request
URL http://data.vikaspedia.in/api/getpage?url=http://vikaspedia.in/social-welfare/social-welfare
Method GET

Request:Parameters
Parameters
urlurl of the page/folder
Response
{'id':1336,'title':'Social Welfare','keystring':'social welfare','url':'http://vikaspedia.in/Plone/social-welfare/social-welfare','createdtime':1365413013000,'bulkid':0,'modified':1438604346000,'portal_type':'Document','path':'/Plone/social-welfare/social-welfare','uid':'7028ffcd0d5646b58f87d57f1db90c00','description':'This section provides information related to women and child development, welfare of SC, ST, minorities, differently abled, senior citizens and other under-served communities. ','reviewstate':'published','parent_id':'social-welfare','parent_uid':'e3fc0335a2044e81be642e9c5dd664b6','tablecontents':0,'averagerating':0.0,'ratingusers':0.0,'apiurl':'http://vikaspedia.in/Plone/Plone/@@API/plone/api/1.0/documents/7028ffcd0d5646b58f87d57f1db90c00','parenturl':'http://vikaspedia.in/Plone/Plone/@@API/plone/api/1.0/folders/e3fc0335a2044e81be642e9c5dd664b6','pageurl':'http://vikaspedia.in/Plone/social-welfare/social-welfare','text':'<h3>Empowering marginalized and vulnerable communities.</h3><p>The Indian government has established an extensivesocial welfare system. Several programmes designed for betterment and enhancement of quality of lifefor SC, ST, BC, Minorities, women, etc stand proof to it./></p>'],'used':0,'ln':'te','domain':2}}
Response:Parameters
Parameters
id Specifies id of the page
title Specifies the title of the page
keystring Specifies the keywords of the page
url Specifies url of that particular page/folder
createdtime Specifies page creation time
modified Specifies page last modified time
portal_type Specifies information of current URL i.e page/folder
path Specifies path to the url
description Specifies description of the page/folder
reviewstate Specifies review state information of that page/folder like published or not
text Specifies the content of the page/folder
language Specifies the language code of the portal
domain Specifies information whether particular url is a vertical of the portal

Request
URL http://data.vikaspedia.in/api/getpageiframe?url=http://vikaspedia.in/social-welfare/social-welfare
Method GET

Request:Parameters
Parameters
urlurl of the page/folder
Response
Response is the same as above with an addtional parameter domains which contains the 6 vertical links of the portal.

Get all the pages/folders

Sends the language code to the server and retrieves all the pages/folders in that portal.


Request
URL http://data.vikaspedia.in/api/getpages?ln=en&pagesize=10&pageno=2
Method GET

Request:Parameters
Parameters
lnlanguage code of the portal content required
pagesize(optional)If mentioned the response is provided till the mentioned number of pages
pageno(optional)The response will be started from the particular page number
Response
{'ln':'en','count':1885,'viewcount':3,'pageno':2,'totalpages':629,'pagelinks':[{'title':'A labour-saving device to cut sugarcane, remove buds','url':'http://vikaspedia.in/Plone/agriculture/best-practices/sustainable-agriculture/farm-machinery/a-labour-saving-device-to-cut-sugarcane-remove-buds','modified':1448348436000,'created':1415361789000,'parent_url':'http://vikaspedia.in/Plone/Plone/@@API/plone/api/1.0/folders/c0cdd73c89c14bb29c3f76ef0031e771','tags':[''],'average_rating':2.7142857142857144},{'title':'Aadhaar card','url':'http://vikaspedia.in/Plone/e-governance/online-citizen-services/government-to-citizen-services-g2c/all-about-aadhaar/aadhaar-card','modified':1448341547000,'created':1427800726000,'parent_url':'http://vikaspedia.in/Plone/Plone/@@API/plone/api/1.0/folders/b769ba014a1f400da7fd44f4fe207f52','tags':[''],'average_rating':2.8461538461538463},{'title':'National Rural Livelihoods Mission','url':'http://vikaspedia.in/Plone/social-welfare/rural-poverty-alleviation-1/schemes/aajeevika','modified':1449809254000,'created':1409068075000,'parent_url':'http://vikaspedia.in/Plone/Plone/@@API/plone/api/1.0/folders/bcb5cf85421b46c3987a5a645f657ba1','tags':[''],'average_rating':3.3181818181818183}],'error':''}
Response:Parameters
lnSpecifies the language code of the portal
countSpecifies the count of the total pages and folders existing in the portal.
viewcountSpecifies the number of pages/folders of which details are displayed.
pagenoSpecifies the pageno of response generated whose default value is 1 except when page number is provided.
totalpagesSpecifies the total number of pages the response is generated when pagesize is mentioned.
pagelinksSpecifies the information like title,url,creation time,last modified time,parent url,keywords(displayed as tags),average ratings of the page and error if any.
.
Insert title here