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


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
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
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Call to API App install failing

Call to API App install failing

Scheduled Pinned Locked Moved Solved Support
apiinstall
5 Posts 3 Posters 830 Views 3 Watching
  • 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.
  • P Offline
    P Offline
    plm27
    wrote on last edited by girish
    #1

    Hello,
    I am testing my Cloudron install with API calls.
    When I try the invoke install app, I am getting a "Bad Request " and I cannot figure out what is wrong with my call, any idea?
    curl -X POST https://my.smthg.com/api/v1/apps/install?access_token=<removed> 26dad6909df7c716ff -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "smthg.com","accessRestriction": "null"}'

    returns

    {
    "status": "Bad Request",
    "message": "appStoreId or manifest is required"
    }
    I first ran, and captured, the install directly from the GUI to validate the parameters, then removed the new app.
    Cheers
    Pierre

    BrutalBirdieB 1 Reply Last reply
    0
    • nebulonN Offline
      nebulonN Offline
      nebulon
      Staff
      wrote on last edited by
      #2

      Can you try to add -H "Content-Type: application/json" to the curl command?

      1 Reply Last reply
      0
      • nebulonN nebulon marked this topic as a question on
      • P plm27

        Hello,
        I am testing my Cloudron install with API calls.
        When I try the invoke install app, I am getting a "Bad Request " and I cannot figure out what is wrong with my call, any idea?
        curl -X POST https://my.smthg.com/api/v1/apps/install?access_token=<removed> 26dad6909df7c716ff -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "smthg.com","accessRestriction": "null"}'

        returns

        {
        "status": "Bad Request",
        "message": "appStoreId or manifest is required"
        }
        I first ran, and captured, the install directly from the GUI to validate the parameters, then removed the new app.
        Cheers
        Pierre

        BrutalBirdieB Offline
        BrutalBirdieB Offline
        BrutalBirdie
        Partner
        wrote on last edited by BrutalBirdie
        #3

        @plm27
        Example fetched directly from the browser when installing an app:

        curl 'https://my.DOMAIN.TLD/api/v1/apps/install' -X POST -H 'Authorization: Bearer REDACTED-TOKEN' -H 'Content-Type: application/json;charset=utf-8' --data-raw '{"appStoreId":"io.hackmd.cloudronapp@1.16.1","subdomain":"hdoc","domain":"DOMAIN.TLD","secondaryDomains":{},"portBindings":{},"accessRestriction":{"users":[],"groups":[]},"cert":null,"key":null,"overwriteDns":false}'
        

        This execute with to correct values for the Domain and Token returns:

        
        "id": "461ea9bb-ed4e-4d19-8e13-dea542e5b19a",
        "taskId": "2441"
        }
        

        Your ?access_token seams odd, I always used bearer token auth.

        Like my work? Consider donating a drink. Cheers!

        1 Reply Last reply
        1
        • P Offline
          P Offline
          plm27
          wrote on last edited by
          #4

          Hi Nebulon,
          Thx, that should be it. I didn't pick up that I forgot the header.
          Testing and reverting.

          P 1 Reply Last reply
          0
          • P plm27

            Hi Nebulon,
            Thx, that should be it. I didn't pick up that I forgot the header.
            Testing and reverting.

            P Offline
            P Offline
            plm27
            wrote on last edited by
            #5

            @nebulon, @BrutalBirdie
            Thx to both of you, the call is now working.
            curl -kX POST -H "Content-Type: application/json" https://my.smthg.com/api/v1/apps/install?access_token=857f7d7eb583cfb951e5a50c75a762b94304d4ba50d4a0c94950643eaab7959a -d '{"appStoreId": "io.n8n.cloudronapp@2.37.0","subdomain": "workflow","domain": "somethg.com","accessRestriction": {"users":[],"groups":[]}}'
            {
            "id": "c6c79d78-7c7c-414b-acf7-8b5cc39370ed",
            "taskId": "269"
            }

            It needed obviously the header, but also I thought reading the API specs that accessRestriction could be null. It is not the case, so I used @BrutalBirdie assignment (empty users and groups) and the call succeeded.
            Once again thank you very much.

            1 Reply Last reply
            1
            • girishG girish has marked this topic as solved on
            • L livingstonlarus referenced this topic on
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

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