Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs
    1. Home
    2. shovaniam
    S
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    shovaniam

    @shovaniam

    1
    Reputation
    1
    Posts
    1
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    shovaniam Follow

    Best posts made by shovaniam

    • RE: Getting "errorCode":"AG8001 while getting historical data

      Instead doing it literally strings as provided in documentation

      OkHttpClient client = new OkHttpClient().newBuilder()
        .build();
      MediaType mediaType = MediaType.parse("application/json");
      RequestBody body = RequestBody.create(mediaType,
           "{\n
              \"clientcode\":\"CLIENT_ID\",\n
              \"password\":\"CLIENT_PIN\"\n
      		\"totp\":\"TOTP_CODE\"\n
          }"
           );
      

      put it in map to reduce chances of error in json format

         // Create a Map to represent the JSON structure
              Map<String, String> requestBodyMap = new HashMap<>();
              requestBodyMap.put("clientcode", "CLIENT_ID");
              requestBodyMap.put("password", "CLIENT_PIN");
              requestBodyMap.put("totp", "TOTP_CODE");
      
              // Convert the Map to JSON
              ObjectMapper objectMapper = new ObjectMapper();
              byte[] requestBodyBytes = objectMapper.writeValueAsBytes(requestBodyMap);
      
              // Create the request body
              RequestBody body = RequestBody.create(mediaType, requestBodyBytes);
      
      
      posted in Bugs
      S
      shovaniam

    Latest posts made by shovaniam

    • RE: Getting "errorCode":"AG8001 while getting historical data

      Instead doing it literally strings as provided in documentation

      OkHttpClient client = new OkHttpClient().newBuilder()
        .build();
      MediaType mediaType = MediaType.parse("application/json");
      RequestBody body = RequestBody.create(mediaType,
           "{\n
              \"clientcode\":\"CLIENT_ID\",\n
              \"password\":\"CLIENT_PIN\"\n
      		\"totp\":\"TOTP_CODE\"\n
          }"
           );
      

      put it in map to reduce chances of error in json format

         // Create a Map to represent the JSON structure
              Map<String, String> requestBodyMap = new HashMap<>();
              requestBodyMap.put("clientcode", "CLIENT_ID");
              requestBodyMap.put("password", "CLIENT_PIN");
              requestBodyMap.put("totp", "TOTP_CODE");
      
              // Convert the Map to JSON
              ObjectMapper objectMapper = new ObjectMapper();
              byte[] requestBodyBytes = objectMapper.writeValueAsBytes(requestBodyMap);
      
              // Create the request body
              RequestBody body = RequestBody.create(mediaType, requestBodyBytes);
      
      
      posted in Bugs
      S
      shovaniam