API List Repositories - Access subdirectory - Not working? (using curl)

Is there another way that I can access a subfolder contents? The way mentioned in the API Repository section is not working.

Using ‘…tree?path=FOLDERNAME’ returns an empty string. Without
the path parameter it works ok but only of course returns the top level
files and folders.

Is there solution or way around this that anyone knows about?
It’s a make or break thing for me being able to use Gitlab, so ideas
appreciated (or if it’s not doable, better to know now as Gitlab API
docs don’t make this fun).

Gitlab.com, acccessing API with PHP curl

Ok, problem solved by doing on of the following (I’m not sure which one solved it):

  • Addded SSH key

  • Used Project ID rather than NAMESPACE/PROJECTNAME in the url.

Then with ?path=SUBDIRECTORY&ref_name=master on the URL, it worked.