简体   繁体   中英

DreamFactory API - http request format

I'm trying to do a simple GET request to my DreamFactory API from a URL in the browser . But I get the error:

Role not found.","code":404

this is my URL:

https://df-xxx.enterprise.dreamfactory.com/api/v2/xxx/_table/user?api_key=xxx

I can do GET and POST request from the Swagger interface in API Docs , why can't I do it from a simple URL in the browser ?

Your error indicates that no role was found. If you have not assigned a default role to your app (associated with your API key) then you will receive this error. If you are providing authentication with a session token, and the authenticated user doesn't have a role associated with that app (API key) then you will receive this error.

All calls in DreamFactory require an API key. They also require a role that permits access to the resource specified in the call. The role is determined by the user's user to app to role relationship, if the call included session information, or by checking the default role for the app, if no session info is provided.

A few exceptions:

  • User login and User registration calls do not require a role or API key.
  • Admin sessions do not require an API key. When you use API Docs in the admin console, the system passes the admin session in the background for you.

See wiki documentation here: http://wiki.dreamfactory.com/DreamFactory/API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM