Files
Olares/docs/developer/develop/advanced/market.md
2025-07-17 11:58:59 +08:00

2.4 KiB

Market

To install or uninstall apps in developing applications (for example, third-party Market extensions), developers can use the install and uninstall API provided by the Market.

For how to define and call provider, please refer to Service Provider

Provider from Market

Group version dataType ops
service.appstore v1 app InstallDevApp
UninstallDevApp

Install

  • Request

    • URL:
      http://$OS_SYSTEM_SERVER/system-server/v1alpha1/app/service.appstore/v1/InstallDevApp

    • Method: POST

    • Header

      X-Authorization: token          # auth_token in cookie
      X-Access-Token: access_token    # access token get from authorization Provider
      
    • Body (Golang struct as an example)

      type InstallOptions struct {
          App string `json:"appName"` //required
          RepoUrl string `json:"repoUrl"` //required
          CfgUrl string `json:"cfgUrl"` //optional
          Version string `json:"version"` //required when upgrading
          Source string `json:"source"` //required
      }
      
  • Success Responses

    type InstallationResponse struct {
        Code int `json:"code"`
        Msg string `json:"message,omitempty"`
        Data InstallationResponseData `json:"data"`
    }
    
    type InstallationResponseData struct {
        UID string `json:"uid"`
    }
    

Uninstall

  • Request

    • URL:
      http://$OS_SYSTEM_SERVER/system-server/v1alpha1/app/service.appstore/v1/UninstallDevApp

    • Method: POST

    • Header

      X-Authorization: token          # auth_token in cookie
      X-Access-Token: access_token    # access token get from authorization Provider
      
    • Body (Golang struct as an example)

      type UninstallData struct {
          Name string `json:"name"` //required
      }
      
  • Success Responses

    type InstallationResponse struct {
        Code int `json:"code"`
        Msg string `json:"message,omitempty"`
        Data InstallationResponseData `json:"data"`
    }
    
    type InstallationResponseData struct {
        UID string `json:"uid"`
    }