{"id":5106,"date":"2022-03-09T03:26:11","date_gmt":"2022-03-09T03:26:11","guid":{"rendered":"https:\/\/help.nafhaa.com\/?docs=nafhaa\/nafhaa-api\/pull-apis"},"modified":"2022-03-09T07:30:11","modified_gmt":"2022-03-09T07:30:11","slug":"pull-apis","status":"publish","type":"docs","link":"https:\/\/help.nafhaa.com\/?docs=nafhaa\/nafhaa-api\/pull-apis","title":{"rendered":"PULL API&#8217;s"},"content":{"rendered":"\n<p>While Pulling data from Nafhaa, first user needs to get Token from Nafhaa site. So first we will see how to access token from Nafhaa.<\/p>\n\n\n\n<h2>Token Access<\/h2>\n\n\n\n<p>Following link used to access token:<\/p>\n\n\n\n<p><strong>URL<\/strong>: http:\/\/[domain name]\/api\/Pull\/Nafhaa\/Token?Username=&lt;user registered with portal>&amp;Password=&lt;password><\/p>\n\n\n\n<p><strong>Request<\/strong>: Get<\/p>\n\n\n\n<p><strong>Response<\/strong>: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" loading=\"lazy\" width=\"402\" height=\"180\" src=\"https:\/\/help.nafhaa.com\/wp-content\/uploads\/2022\/03\/image-6.png\" alt=\"\" class=\"wp-image-5131\" srcset=\"https:\/\/help.nafhaa.com\/wp-content\/uploads\/2022\/03\/image-6.png 402w, https:\/\/help.nafhaa.com\/wp-content\/uploads\/2022\/03\/image-6-300x134.png 300w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><figcaption>You will receive the above response when Username, Password matches properly and finally all the configuration for API are found correct. The response will contain the Token and Token Validity after which the Token will be invalid and you need to pull the new token from the portal.<\/figcaption><\/figure>\n\n\n\n<h2>API With date parameters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Sr<\/strong><strong><\/strong><\/td><td><strong>Module<\/strong><strong><\/strong><\/td><td><strong>Request<\/strong><strong><\/strong><\/td><td><strong>Type<\/strong><strong><\/strong><\/td><td><strong>Start Date<\/strong><strong><\/strong><\/td><td><strong>End Date<\/strong><strong><\/strong><\/td><\/tr><tr><td>1<\/td><td>Proforma<\/td><td>proforma<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>2<\/td><td>Cashbook<\/td><td>cashbook<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>3<\/td><td>Sales<\/td><td>sales<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>4<\/td><td>Sales Return<\/td><td>salesreturn<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>5<\/td><td>Purchase<\/td><td>purchase<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>6<\/td><td>Purchase Return<\/td><td>purchasereturn<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>7<\/td><td>Sales Order<\/td><td>salesorders<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>8<\/td><td>Tasks<\/td><td>tasks<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><tr><td>9<\/td><td>Enquiry<\/td><td>enquiry<\/td><td>Json<\/td><td>Required<\/td><td>Required<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>As mentioned in above chart API calls can be done. Following is one example how the chart works:<\/p>\n\n\n\n<p>Suppose user wants to get list of Proforma records then user will do following request:<\/p>\n\n\n\n<p>URL:http:\/\/[domain name]\/api\/Pull\/Nafhaa?NAuth=&lt;NAuthKey>&amp;Request=proforma&amp;Type=json&amp;StartDate=2021-12-01&amp;EndDate=2022-03-01<\/p>\n\n\n\n<h2>API Without date parameters<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Sr<\/strong><strong><\/strong><\/td><td><strong>Module<\/strong><strong><\/strong><\/td><td><strong>Request<\/strong><strong><\/strong><\/td><td><strong>Type<\/strong><strong><\/strong><\/td><\/tr><tr><td>1<\/td><td>Contact<\/td><td>contacts<\/td><td>Json<\/td><\/tr><tr><td>2<\/td><td>Products<\/td><td>products<\/td><td>Json<\/td><\/tr><tr><td>3<\/td><td>Currency<\/td><td>currency<\/td><td>Json<\/td><\/tr><tr><td>4<\/td><td>Company<\/td><td>companies<\/td><td>Json<\/td><\/tr><tr><td>5<\/td><td>City<\/td><td>City<\/td><td>Json<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>These are master modules data. So no need for date.<\/p>\n\n\n\n<p>This is all about PULL API&#8217;s in Nafhaa API.<\/p>\n","protected":false},"author":2,"featured_media":0,"parent":5101,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":[],"doc_tag":[],"_links":{"self":[{"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs\/5106"}],"collection":[{"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5106"}],"version-history":[{"count":4,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs\/5106\/revisions"}],"predecessor-version":[{"id":5134,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs\/5106\/revisions\/5134"}],"up":[{"embeddable":true,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs\/5101"}],"next":[{"title":"PUSH API's","link":"https:\/\/help.nafhaa.com\/?docs=nafhaa\/nafhaa-api\/push-apis","href":"https:\/\/help.nafhaa.com\/index.php?rest_route=\/wp\/v2\/docs\/5109"}],"wp:attachment":[{"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5106"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/help.nafhaa.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdoc_tag&post=5106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}