Wiki Home Settings page == API settings ==

== API settings ==

2024-04-26
api

  1. Please log in to the Admin panel using the "Admin" account, not an account with admin rights, as the generated API will not function otherwise.
  2. When switching the iCafeCloud server between master and slave servers (ex: EU3 to EU4 ), there is no need to modify the API, as the API remains unchanged. However, if you change the servers (ex: EU3 to EU18) the API key must be recreated.
  3. From the "Settings" page of the Cloud Panel, you can generate your API key by pressing the create button (Figure 1). The api key expiration time is one year.

Figure 1

  1. The API address is fixed as api.icafecloud.com
  2. Once you create a new API key, the old API key will become invalid. We only support one API key at a time. (Figure 2)

Figure 2

  1. Click the "Copy" button and save your api key. It's only shown once.
  2. API docs https://dev.icafecloud.com/docs/ (Figure 3).

Figure 3

  1. You need to add a http header with the "Authorization: Bearer api_key" to authenticate the API access.
  2. To add parameters on the API use Body and not Headers.[On postman can use Body , Form-data and add parameters. (Figure 4)

Figure 4


  1. The API endpoint URL should always use HTTPS not HTTP.
  2. You can try the API directly on the iCafeCloud dev.icafecloud.com. Follow these steps:
    Click the link to
    https://dev.icafecloud.com/docs/#boot-pcs-apis
    Click the "Try it out" button.
    Fill in the Bearer token and CafeID, which you can find in your iCafeCloud license.
    Click "Send Request" to retrieve data from the PCs.
    This process allows you to interact with and test the API functionalities effectively.(Figure 5)

Figure 5

  1. Notify balance changes to client PC. Once you've initiated the top-up API call, the next step would be to call the pushClientstatus API. This step is crucial as it ensures that the client's PC is notified of the update.
  2. For the API to auto add bonus on topup use:
    To get the bonus =  POST api/v2/cafe/{cafeId}/members/action/fetchBonus
    And use it as parameter at = POST api/v2/cafe/{cafeId}/members/action/topup -> topup_balance_bonus (Figure 6)

Figure 6

Related: