This Code is a working code to use FlatTarade API For this code to perform in resource you have to add the SID file, there you have to mention the proper SID for that day, and it has to be updated manually.
SID you can get by going to this url
https://auth.flattrade.in/?app_key=
like this
https://auth.flattrade.in/?app_key=8cac21d8da3c4430a357e16423d14d73
Then you will see that the SID will show in browser
copy that SID and place that in the SID file.
Delete that Token file also present in the Resource file. This activity has to be performed daily because token and sid expires shortly.