History API error

i am having error like {

code: -403,

message: ‘You do not have permission to access this application’,

s: ‘error’

}

even though i have history permission

const FyersAPI = require(“fyers-api-v3”).fyersModel

    var fyersV3 = new FyersAPI()

    // Set up fyers instance

    fyersV3.setAppId(appId);

    fyersV3.setRedirectUrl("[http://localdev](http://localdev.market:3000/)

:3000/");

    fyersV3.setAccessToken(accessToken);

var inputs = {

                "symbol": symbol,

                "resolution": resolution,

                "date_format": "1",

                "range_from": range_from || formattedYesterday,

                "range_to": range_to || formattedYesterday,

                "cont_flag": "1"

            }

           

            

            var result;

            console.log(inputs);

            fyersV3.getHistory(inputs).then((response) => {

                console.log(response)

                result=response

            }).catch((err) => {

                console.log(err)

                console.log("inputs",inputs);

            })

I too had a similar problem in past. Try giving all permissions to the app, it will work then.
It appears to be a bug where it does not work with specific permissions singly.

Hey @thisisoptionbuyer-p3l

This error is occuring as the relevant app permissions have not been given from you’re end , kindly give the permissions in the API dashboard .

Hai Abhishek, in the screen shot that i send , it have permisssion or not

Have you checked or not, how to add permission to an app, if i edit , i can only able to ad webhooks

is anyone known abut this

You will have to create new app, we cannot edit permissions of existing app. Create another one with all permissions and give a try.

@communications_team team, please test the issue from your end as well. This appears to be a bug with specific permissions not working singly, eg. Historical Data permission does not allow History API access.