Access token API keeps throwing Bad request

chamu
Hi,
I recently started to version 3 migration. My app was working good with version 2.
With version 3, I am unable to get access token even after I provided all required params (api_key, request_token and checksum). I always get bad request with message "Missing or invalid field `api_key`. Min length is 6."
I am trying access token post using RestClient (chrome plug in)
Please let me know if I am missing any.
Thanks
  • sujith
    You need to make a form request (send data in the body) and not JSON POST request.
  • chamu
    Hi Sujith,

    I tried as a form request as you suggested. I am getting this message now:
    "message": "Token is invalid or has expired."

    Thanks.
  • sujith
    You can check out this thread.
  • chamu
    Hi Sujith,

    Thanks for the pointer to the thread. However, am getting "Token is invalid or has expired." on the first call of session/token. I am not getting the access token at all.

    Thanks
  • sujith
    But this message can be seen only when you try to re-use the access token.
  • chamu
    No.. am using the request_token and accessing the session/token :(
    I am seeing the expiry error on first call
  • chamu
    @sujith what do I do now? am unable to get the access token.. it was working with v2.
    I paid 2k for this month an its already 17th..
    please help..
  • tonystark
    @chamu You must be missing something. Can you follow this webinar?
  • chamu
    @tonystark I was getting the access token with v2. I am facing this problem after v3 migration. I dont see any changes in API request to get the access token from v2 to v3.

    Note: I create an app last year, used for a month and was inactive till this month, this month I reactivated it to migrate to v3. Is this any cause?

    Thanks
  • sujith
    @chamu,
    You need to make a form request for fetching access token. The earlier version of Kite Connect API was accepting json request also but now it is mandatory to send a form request with data in the body.
    It has nothing to do with your app being inactive for some time.
  • chamu
    @sujith I am sending form post itself
  • sujith
    Can you enable debug logs and paste it here?
    You may also paste the code here.
Sign In or Register to comment.