I could download the files but only as json using the below command:
curl -L -O -G -H "X-Auth-User:userName" -H "X-Auth-Token:userToken" http://xx.xxx.xxx.xxx:7990/rest/api/1.0/projects/DOC/repos/xxx/browse/Jenkinsfile -d at=refs/heads/jenkinsfile -d raw
X-Auth-Token provided in the above URL is obtained from Token authentication plugin .
But my aim is
1. To download raw file using above format (not in json format)
2. To have a service account and require a common token for it and download the raw file from a repo
Any help would be appreciated!