Updated REST API samples?

Hi all, I’m working on a project (CUBA 7) and I need to get REST API to communicate with a mobile app. I’m reading documentation but in no way can I get REST working correctly, and all information I found is outdated. I have role created, assigned to admin user (dev testing), addon installed and so on… I readed documentation, but I think is not so much clear for devs like me not accustomed to Java and/or REST and his config files.

Right now I’m getting an annoying “Invalid basic authentication token”, in previous weeks I got it working (not remember how) but but with entities returning only uuids and not the complete view. I readed I muts write on app.properties a value to cuba.rest.client.secret but not clear exactly what I must put there. I tried with 12345678 and using this value on my request for Basic 12345678, but not working, I tried too with {noop}12345678 in config file, with same failure.

Exists some updated sample to see exactly with files I must change to get it working? Thanks

Ok nevermind. Solved. I found the id and secret in other files I was not looking (web-app.properties) and now works. Just one thing. User and pass should be in URL? If I put this parameters as header instead in URL, it returns a bad credentials (both has auth in auth tab, for this under headers it’s unchecked)
imagen imagen

as stated in the documentation token request type must be application/x-www-form-urlencoded and the parameters must be in request body. See the screenshot:

1 Like