Page History
Sv translation | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
You can create your own API Endpoints using BellaDati Extensions feature. This tutorial describes how to create an endpoint which exports public Report to XLS. You can download complete Extension with an endpoint here and import it to BellaDati Extensions. Refer to Importing Extensions section in Extensions documentation. Preconditions
TutorialStep 1. Create an Extension
Step 2. Create an API Endpoint in ExtensionAfter creating the Extension you should be redirected to Extension detail.
Step 3. Write code which will export Report to XLS and send it to clientAfter creating the Endpoint you should be redirected to Endpoint detail with code editor where you can write/paste your code. In the Endpoint class are 2 methods, doGet() and doPost(). Each will be executed based on the endpoint call method (GET/POST). We will call this endpoint as GET so we will write the code in the doGet() method. Refer to the code below:
Step 4. Endpoint usageExtension has to be activated before the endpoint can be used. We also have to activate Public access so public users will be able to use the endpoint. Endpoint is now ready to use so we can try it. Clicking on Link above the code editor will open URL with our endpoint. We just have to append parameter "reportId" with ID of Report which should be exported (refer to implementation above). Your URL should look like this:
Example usage in HTML:
|
Sv translation | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
拡張を使用して、独自のAPIエンドポイントを作成できます。このチュートリアルでは、パブリックレポートをXLSにエクスポートするエンドポイントを作成する方法について説明します。 ここからエンドポイントを含む完全な拡張機能をダウンロードして、BellaDati拡張機能にインポートできます。拡張機能の「拡張機能のインポート」セクションを参照してください。 前提条件
チュートリアルStep 1. 拡張機能の作成
Step 2. 拡張機能でAPIエンドポイントを作成する拡張機能を作成した後、拡張機能の詳細にリダイレクトする必要があります。
Step 3. レポートをXLSにエクスポートしてクライアントに送信するコードを記述しますエンドポイントを作成した後、コードを記述/貼り付けることができるコードエディタを使用して、エンドポイントの詳細にリダイレクトする必要があります。 Endpointクラスには、 doGet()とdoPost()の2つのメソッドがあります。それぞれがエンドポイント呼び出しメソッド(GET/POST)に基づいて実行されます。 このエンドポイントをGETで呼び出すために、doGet()メソッドでコードを記述します。以下のコードを参照してください:
Step 4. エンドポイントの使用エンドポイントを使用する前に、拡張機能をアクティブ化する必要があります。また、パブリックユーザーがエンドポイントを使用できるように、パブリックアクセスをアクティブ化する必要があります。 これでエンドポイントを使用する準備ができたので、試してみることができます。 コードエディタの上にあるリンクをクリックすると、エンドポイントを含むURLが開きます。エクスポートするレポートのIDを、"reportId"パラメーターに追加するだけです(上記の実装を参照)。 URLは次のようになります:
HTMLでの使用例:
|