Update profile file parts with http api

@synesthesiam I guess this question is for you :rofl:

Seeing this: https://rhasspy.readthedocs.io/en/latest/reference/#http-api

I would like to know if it’s possible to post on /api/profile some part of profile setting.
For example, send to rhasspy to update just these parts of user profile:

{
"handle": {
       "system": "remote",
       "remote": {
           "url": "http:/xxxx"
       }
   },
"webhooks": {
   	"awake": ["http://xxx"]
   }
}

Otherwise, I guess I can get entire profile with /api/profile?layers=profile, update the json, and post it back ?

Not at home right now, will do some test but any insight would help :wink:

1 Like

Ahah, works perfect !!!

I GET the profile, update it, POST it and GET it again to check all went nice.

So now, the user of the jeedom plugin has nothing to do on rhasspy interface, just hit to “configure” button to set remote and awake :+1:

This http api is so powerfull, really a big big plus over snips, definitely !

:hugs:

2 Likes

Ok, have a problem anyway

@synesthesiam

After using /api/profile to update the profil, the json profile file is updated no problem.

Then, rhasspy need to restart, so I do a GET /api/restart
-> I have it in the log, but it doesn’t update. I have to manually hit restart button in rhasspy interface so the new profile is taken.

Did I miss something there ?

In public/swagger.yaml there is:

  /api/restart:
    post:
      summary: 'Restart the Rhasspy server'
      parameters:
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                type: string

:+1:

Should be a POST to /api/restart

Yes saw it, works perfectly :wink:
Http api is just invaluable !!

1 Like