I new to this and i have very simple question. I want to be able to get data from dream factory. If i go to API docs and generate request url https://myDPSName.cloud.dreamfactory.com:443/rest/db and then go to that site it shows me this:
{“error”:[{“context”:null,“message”:“No application name header or parameter value in request.”,“code”:400}]}
when i should get:
{
“resource”: [
{
“name”: “Events”,
“label”: “Events”,
“plural”: “Events”,
“access”: [
“GET”,
“POST”,
“PUT”,
“PATCH”,
“MERGE”,
“DELETE”
]
},
{
“name”: “todo”,
“label”: “Todo”,
“plural”: “Todos”,
“access”: [
“GET”,
“POST”,
“PUT”,
“PATCH”,
“MERGE”,
“DELETE”
]
}
]
}
HEEEEELP
All API calls require you to pass a session token for authentication with the system (or have guest access enabled) and for you to pass an application name (which works like an API key.)
When you use the API Docs page of the admin console, this is done for you in the background. You are already authenticated because you logged in to the console, and API Docs passes the application called admin.
When you make calls from outside this system you have to pass this information manually. You’ll want to review the REST API documentation for the specifics of how to pass these headers, which can be found here: https://github.com/dreamfactorysoftware/dsp-core/wiki/REST-API
Thanks, but could you give just an example url. I tried various options, didnt workout.
From the Common Headers Parameters page of the documentation
(https://github.com/dreamfactorysoftware/dsp-core/wiki/Common-Headers-Parameters)
API Key (currently also referred to as ‘Application Name’)…
URL Parameter - Add ?app_name=**api_key**
to the end of each endpoint request URL sent to the DSP.
HTTP Header - Add X-DreamFactory-Application-Name: header to each request sent to the DSP.
1 Like