Serch Pincode Details Using api

Discussion in 'Free Source Codes' started by sattam, Jan 5, 2023.

    
  1. sattam

    sattam Active Member


    I search this free api in the web which responce pincode details in json format
    Now I want to store this json responce in collection
    But I can't understand where is my mistake its not stored value in collection
    Dear expert please help me
    It will be very useful for everyone to create address using pincode in ledger master

    Code:
    [System: Formula]
     
        SatSearchPin: "https://api.postalpincode.in/Pincode/711101"
     
    [Collection:SatHttpJsonPinColl]
    
        Data Source:HTTP JSON:@@SatSearchPin
        JSON Object Path:"PostOffice:1"
        Fetch        : PostOffice.*,*.*
        Client Only:Yes
    
    /* 
    [Object:satpinprimaryobj]
     
        Collection:satpincoll:satpinobj
     
    [Object:satpinobj]
     
        Storage:Message:String
        Storage:Status:String
        Collection:PostOffice:postoffobj
     
    [Object:postoffobj]
     
        Storage:Name:String
        Storage:Division:String
        Storage:District:String
        Storage:State:String
        Storage:Pincode:String
     
    [Collection:PostOffice]
        [Collection:satpincoll]
         
    [Object:PostOffice]
        [Object:satpincoll]
    */ 
    [Collection:PostOffice]
     
         
    [Collection:SatWebPincodeColl]
     
        Source Collection:SatHttpJsonPinColl
        Fetch        : PostOffice.*,*.*
     
        ;Compute:Message:$Message
        ;Compute:Status:$Status
        ;Walk:PostOffice
     
        Compute:SatPoName:$Name
        Compute:SatPoCity:$Division
        Compute:SatPoBlock:$Block
        Compute:SatPoDist:$District
        Compute:SatPoState:$State
        Compute:SatPoPincode:$Pincode
        FORMAT : $SatPoName,20
     
        Search Key:$SatPoName
     
    [Collection:SatWebPinDetails]
     
        Title:$$LocaleString:"List Of Cities"
        SUBTITLE        : Post Office,City ,District ,State,Pincode
        Source Collection:SatWebPincodeColl
        Full Height:Yes
        Column Align: Left, Left
        Align:Left
        Color              : "DarkBlue16Bit"
        FETCH             : SatPoCity,SatPoDist,SatPoState,SatPoName,SatPoPincode;,Message,Status
     
        FORMAT            : $SatPoName,20
        FORMAT            : $SatPoCity,20
        FORMAT            : $SatPoDist,20
        FORMAT            : $SatPoState,20
        FORMAT            : $SatPoPincode,6
        UNIQUE            : $SatPoName
     
        Table Sort          : $SatPoPincode
        Search Key          : $SatPoPincode
     
    [#Form:Ledger]
     
        Add:Button:satPinSerch
     
    [Button:satPinSerch]
     
        Title:"Pin Serch"
        Key:Alt+3
        Action:Display :SatWebPinDetailsRep
     
    [Report : SatWebPinDetailsRep]
     
     
        Form : ImportStatusLedForm
     
     
    [Form : ImportStatusLedForm]
     
     
        Width       : 100% Screen
        Height      : 100% Screen
        Part : ISLEDMainPart
     
    
    [Part : ISLEDMainPart]
     
        Lines : ISLEDHeaderLine, ISLEDDetailsLine
        Repeat : ISLEDDetailsLine : SatWebPinDetails;Sat Web Pincode Coll;
        Scroll : Vertical
    
    [Line: ISLEDHeaderLine]
        Fields : ISLEDSrNoHField, ISLEDNameHField
        Right Fields: ISLEDStatusHField
        Border :    Thin Box
    
    [Line: ISLEDDetailsLine]
        Fields : ISLEDSrNoField, ISLEDNameField,
        Right Fields: ISLEDStatusField
        Border :    Thin Bottom
    
    [Field: ISLEDSrNoHField]
        Width : 30 mms
        Type : String
        Set as : "Post Office Name"
        Skip : Yes
        Border : Thin Left Right
        Style : Normal Bold
    
    [Field: ISLEDNameHField]
        Width : 120 mms
        Type : String
        Set as : "City Name"
        Skip : Yes
        Border : Thin Left Right
        Style : Normal Bold
    
    [Field: ISLEDStatusHField]
        Width : 170 mms
        Type : String
        Set as : "District Name"
        Skip : Yes
        Border : Thin Right
        Style : Normal Bold
     
    [Field: ISLEDSrNoField]
        Width : 30 mms
        Set as : $SatPoName
        Border : Thin Left Right
    
    [Field: ISLEDNameField]
        Width : 120 mms
        Set as : $SatPoCity
        Border : Thin Left Right
    
    [Field: ISLEDStatusField]
        Width : 170 mms
        Set as : $SatPoDist
        Border : Thin Right
    
    ;; LedMaster Template
    
    ;; End-of-File
    
    
    
     
    
    
    Code not fully completed yet.
     


  2. sattam

    sattam Active Member


    Any solution experts?
     



  3. By executing url we are getting Json array [] and not object {}. The nearest future solution is write vbs (vbscript) or http service to convert array to object.
    If possible to xml. Then it will be easy to map to tdl object. Will wait until a week I will give either .exe or .vbs to solve the issue. If meanwhile anybody having solution kindly update.
     
    sattam likes this.


  4. sattam

    sattam Active Member


    Thanks Mr.Tushar waiting for your efforts.
     


  5. Sai Vineeth

    Sai Vineeth Active Member




  6. PFA a TDL. I have done some minor alteration. On
    Code:
    [#Form:Ledger]
        Add:Button:satPinSerch
    [Button:satPinSerch]
        Title:"Pin Serch"
        Key:Alt+3
        Action:Call    : DownloadFile and Display Report
        [Function:DownloadFile and Display Report]
            Local Formula:isExeExist    : $$IsFileExists:"postoffice.exe"
            090    : IF:@isExeExist
            100    :     Exec Commandex: "postoffice.exe":700001        ;;here give parameter to exe
            110    :     Display:SatWebPinDetailsRep
            150    : Else
            160    :    Msg Box:ERR:"Supported File Does not exist \n download from \n \nhttps://github.com/Prachi-Infosoft/Postoffice-API-For-Tally.git"
            170    : ENDIF
    [Report : SatWebPinDetailsRep]
        Form : ImportStatusLedForm
    [Form : ImportStatusLedForm]
        Width       : 100% Screen
        Height      : 100% Screen
        Part : ISLEDMainPart
    
    [Part : ISLEDMainPart]
        Lines : ISLEDHeaderLine, ISLEDDetailsLine
        Repeat : ISLEDDetailsLine : SatHttpJsonPinColl
        Scroll : Vertical
    
    [Line: ISLEDHeaderLine]
        Fields : ISLEDSrNoHField, ISLEDNameHField
        Right Fields: ISLEDStatusHField
        Border :    Thin Box
    
    [Line: ISLEDDetailsLine]
        Fields : ISLEDSrNoField, ISLEDNameField,
        Right Fields: ISLEDStatusField
        Border :    Thin Bottom
        Local:Field:ISLEDSrNoField:Set as:$$Line
       
    [Field: ISLEDSrNoHField]
        Width : 30 mms
        Type : String
        Set as : "Post Office Name"
        Skip : Yes
        Border : Thin Left Right
        Style : Normal Bold
    
    [Field: ISLEDNameHField]
        Width : 120 mms
        Type : String
        Set as : "City Name"
        Skip : Yes
        Border : Thin Left Right
        Style : Normal Bold
    
    [Field: ISLEDStatusHField]
        Width : 170 mms
        Type : String
        Set as : "District Name"
        Skip : Yes
        Border : Thin Right
        Style : Normal Bold
    [Field: ISLEDSrNoField]
        Width : 30 mms
        Set as : $SatPoName
        Border : Thin Left Right
    
    [Field: ISLEDNameField]
        Width : 120 mms
        Set as : $Name
        Border : Thin Left Right
    
    [Field: ISLEDStatusField]
        Width : 170 mms
        Set as : $District
        Border : Thin Right
    
    
    [System: Formula]
        SatSearchPin: "https://api.postalpincode.in/Pincode/422401"
        postofficefilepath : $$SysInfo:ApplicationPath + "\postoffice.json"
    [Collection:SatHttpJsonPinColl]
    
        Data Source:File JSON:@@postofficefilepath:ASCII
       
        JSON Object Path:"postoffice:1"
       
        Client Only:Yes
    Please download EXE file from "https://github.com/Prachi-Infosoft/Postoffice-API-For-Tally.git" and put it in tally folder.

    exe file wants the parameter of PINCODE. It will download json file as required by Tally.

    still you have any query pls feel free to call on 84597 94367.
     
    sattam likes this.


  7. sattam

    sattam Active Member


    Thanks Mr.Vineeth and Mr. Tushar both you provided are working fine
     


  8. sattam

    sattam Active Member


    any solution about pin to pin distance api
     


  9. Rohit Khedar

    Rohit Khedar Member


    Sattam sir do explain with screenshot
     


  10. love

    love Member



  11. Mahesh Sethi

    Mahesh Sethi Member


    Dear Tushar Ji,

    As per your instruction the Postoffice.exe in not download. pls provide me on tally_indore@yahoo.com

    Thanks & Regards,

    Mani
     



  12. Pin to Pin Distance can only be acheived thru API which comes majorly from Google.. there are other API but not sure about the accuracy.. and also for india its available or not
     




  13. Mahesh Sethi

    Mahesh Sethi Member




  14. Kindly see that your browser is adding something extra.
    Where is raw in my given url. Something hacking is going on sir.....
     


  15. DEEPAK B

    DEEPAK B Member


    Sattam Sir I had done lots of RnD for this but was not able to find and free api

    But I got this which give accurate distance but in excel through VBA see if this can help



    and the other one is free first it ask you to register (Free Registration)

    www.bing.com/maps
     


  16. sattam

    sattam Active Member


    Hello Tushar ji fetch similar issue
    I purchased an API it returns json with same Array issue
    could you please make an application to reslove the issue
    Below is the json response

    {
    "flag": true,
    "message": "Gstin return found.",
    "data": {
    "filingStatus": [
    [
    {
    "fy": "2022-2023",
    "taxp": "October",
    "mof": "ONLINE",
    "dof": "09/02/2023",
    "rtntype": "GSTR1",
    "arn": "NA",
    "status": "Filed"
    }
    ]
    ],
    "status": "No records Found"
    }
    }
     


Share This Page