Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    GetOIData

    C#/.Net SDK
    0
    2
    7
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      R263546 last edited by

      {"exchange":"NFO","symboltoken":"35006","interval":"THREE_MINUTE","fromdate":"2025-01-01T09:25:00","todate":"2025-01-01T10:25:00"}
      using URL - string URL = APIURL + "/rest/secure/angelbroking/historical/v1/getOIData";

      Message - Invalida date or time format
      error code AB13000

      tried all possible ways to send date time
      //string fromdate = "2025-01-01 09:25";
      //string todate = "2025-01-01 10:25";
      //string date_time_format = "yyyy-MM-dd HH:mm";

              string fromdate = "2025-01-01 09:25";
              string todate = "2025-01-01 10:25";
              string date_time_format = "yyyy-MM-dd hh:mm";
      
              DateTime datetime_fromdate = DateTime.ParseExact(fromdate, date_time_format, CultureInfo.InvariantCulture);
              DateTime datetime_todate = DateTime.ParseExact(todate, date_time_format, CultureInfo.InvariantCulture);
      
              // Create a DateTime object from the string
      

      ////DateTime datetime_fromdate = DateTime.ParseExact(fromdate, date_time_format, null);
      ////DateTime datetime_todate = DateTime.ParseExact(todate, date_time_format, null);

      1 Reply Last reply Reply Quote 0
      • A
        admin last edited by

        @R263546 please try using postman, it is working.

        Below is the API snippet that works.

        {
             "exchange": "NFO",
             "symboltoken": "35006",
             "interval": "THREE_MINUTE",
             "fromdate": "2025-01-01 09:25",
             "todate": "2025-01-01 10:25"
        }
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post