Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Cloudron Forum

Apps | Demo | Docs | Install

Unable to use API for firefly-iii

Scheduled Pinned Locked Moved Firefly III
5 Posts 2 Posters 280 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • lepismaL Offline
    lepismaL Offline
    lepisma
    wrote on last edited by
    #1

    Hi,

    I recently installed firefly-iii from cloudron marketplace. While the application itself is working nicely, I needed to write a custom importer and for that wanted to hit the REST API.

    The API is supposed to be present at /api/v1/... but I am always getting the login HTTP page back. I was thinking there is some issue with my code, request headers, etc. But I tried changing the url from https://<my-website>/api/v1/transactions to https://demo.firefly-iii.org/api/v1/transactions (firefly's demo server) and the same requests are working.

    Is this related to how cloudron is setting up firefly-iii? I also checked firefly-iii configuration and there was no way to enable/disable REST API.

    Can I get some help here?

    girishG 1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    replied to lepisma on last edited by
    #2

    @lepisma I can reproduce this one.

    I suspect this has to do with proxyAuth in the package not configured properly for API access (it's not passing through bearer headers). Investigating.

    1 Reply Last reply
    1
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #3

    I misunderstood what 'Command line token' means. I thought this was the API token. It isn't. It's actually the token for running cron jobs over the web - https://docs.firefly-iii.org/firefly-iii/advanced-installation/cron/#request-a-page-over-the-web

    1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by girish
    #4

    Indeed, one must create a Personal Access Token from the OAuth page.

    13988f2d-cb15-4b95-8944-fc42702b4e42-image.png

    $ curl -LX GET 'https://ff3.example.com/api/v1/about'  -H 'accept: application/vnd.api+json' -H 'Authorization: Bearer xx'   -H 'Content-Type: application/json'
    {"data":{"version":"5.7.10","api_version":"1.5.6","php_version":"8.0.21","os":"Linux","driver":"pgsql"}}
    

    The above works without proxyAuth. Will now test with proxyAuth enabled.

    1 Reply Last reply
    0
  • girishG Offline
    girishG Offline
    girish Staff
    wrote on last edited by
    #5

    To support Bearer authentication with proxyAuth, I have added a new flag in the manifest called supportsBearerAuth . This will be available in 7.3. After that, the curl request works.

    1 Reply Last reply
    0

  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Login

  • Don't have an account? Register

  • Login or register to search.