Hi,
I’m a Df beginer and C# newbie, however I have to connect to a DF rest and send files, I succeed to log in but the response from the HttpRequest doesnt show any “token”, I must precise that I did not produce the APi but when trying it from the DF portal, the curl command shows a token and an Api.
Do someone will have pity on me ?
==> no code samples are available in C#
i’m quite newbie too, but I recommand you to validate steps and setup by testing with Postman client before going to code client.
This will enable you to validate URI, endpoint, login step, header build
In you case
- call URI like https://domainname.com/api/v2/user/session with body JSON similar to
{
“email”: “test @ test . com”,
“password”: “testpassword”
} - read response to collect “session_token” value that should be added in header key “X-DreamFactory-Session-Token” for next requests on your service
Until you don’t get a correct response with “session_token”… issue is probably about setup on your DreamFactory. So dont focus on your code yet.
Something to add
API-Key is generated by DreamFactory when you create an App
Logical order to start a API service
- create a service
- create a role defining access for service
- create a user using role for service
- create an app to consume service with a user
To test HTTP service (in fact intelligent proxy for existing API) try to use public API like https://petstore3.swagger.io/api/v3/ according to me it’s a good way to start how DF is working.
Thanks, indeed I was missing the first step.