Skip to content

Commit 79a8a7c

Browse files
Added section about using SDKs with Docker version
1 parent 5256844 commit 79a8a7c

1 file changed

Lines changed: 116 additions & 0 deletions

File tree

content/viewer/getting-started/how-to-self-host-groupdocs-viewer-cloud-with-docker.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ We generate our SDKs in different languages so you may check if yours is availab
117117
If you don't find your language in the SKD list, feel free to request for it on our [Support Forums](https://forum.groupdocs.cloud/c/viewer), or use raw REST API requests as you can find it [here](https://products.groupdocs.cloud/viewer/curl).
118118
{{< /alert >}}
119119

120+
The authentication is required in case you're going to use SDK. To enable authentication set CLIENT_ID/CLIENT_SECRET parameters as it shown below.
121+
120122
{{< tabs tabTotal="2" tabID="3" tabName1="Windows (PowerShell)" tabName2="Linux (bash)" >}} {{< tab tabNum="1" >}}
121123

122124
```powershell
@@ -149,6 +151,120 @@ docker run \
149151

150152
{{< /tab >}} {{< /tabs >}}
151153

154+
Then, when using SDK, setup the api base url, as shown in examples below:
155+
156+
{{< tabs tabTotal="6" tabID="10" tabName1="C#" tabName2="Java & Android" tabName3="PHP" tabName4="Node.js" tabName5="Python" tabName6="Ruby" >}} {{< tab tabNum="1" >}}
157+
158+
```csharp
159+
160+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-dotnet-samples
161+
string ClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
162+
string ClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
163+
164+
var configuration = new Configuration(ClientId, ClientSecret)
165+
{
166+
ApiBaseUrl = "http://localhost:8080"
167+
};
168+
var apiInstance = new InfoApi(configuration);
169+
var response = apiInstance.GetSupportedFileFormats();
170+
171+
```
172+
173+
{{< /tab >}} {{< tab tabNum="2" >}}
174+
175+
```java
176+
177+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-java-samples
178+
String ClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
179+
String ClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
180+
181+
Configuration configuration = new Configuration(ClientId, ClientSecret);
182+
configuration.setApiBaseUrl("http://localhost:8080");
183+
184+
InfoApi apiInstance = new InfoApi(configuration);
185+
FormatsResult response = apiInstance.getSupportedFileFormats();
186+
187+
```
188+
189+
{{< /tab >}} {{< tab tabNum="3" >}}
190+
191+
```php
192+
193+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-php-samples
194+
use GroupDocs\Viewer\Model;
195+
use GroupDocs\Viewer\Model\Requests;
196+
197+
$ClientId = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
198+
$ClientSecret = ""; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
199+
200+
$configuration = new GroupDocs\Viewer\Configuration();
201+
$configuration->setAppSid($ClientId);
202+
$configuration->setAppKey($ClientSecret);
203+
$configuration->setApiBaseUrl("http://localhost:8080");
204+
205+
$infoApi= new GroupDocs\Viewer\InfoApi($configuration);
206+
207+
$response = $infoApi->getSupportedFileFormats();
208+
209+
```
210+
211+
{{< /tab >}} {{< tab tabNum="4" >}}
212+
213+
```javascript
214+
215+
// For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-node-samples
216+
global.viewer_cloud = require("groupdocs-viewer-cloud");
217+
218+
global.clientId = "XXXX-XXXX-XXXX-XXXX"; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
219+
global.clientSecret = "XXXXXXXXXXXXXXXX"; // Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
220+
const config = new Configuration(clientId, clientSecret);
221+
config.apiBaseUrl = "http://localhost:8080";
222+
global.infoApi = viewer_cloud.InfoApi.fromConfig(config);
223+
224+
let response = await infoApi.getSupportedFileFormats();
225+
226+
```
227+
228+
{{< /tab >}} {{< tab tabNum="5" >}}
229+
230+
```python
231+
232+
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-python-samples
233+
import groupdocs_viewer_cloud
234+
235+
client_id = "XXXX-XXXX-XXXX-XXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
236+
client_secret = "XXXXXXXXXXXXXXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
237+
238+
configuration = Configuration(client_id, client_secret)
239+
configuration.api_base_url = "http://localhost:8080"
240+
241+
infoApi = groupdocs_viewer_cloud.InfoApi.from_config(configuration)
242+
243+
result = infoApi.get_supported_file_formats()
244+
245+
```
246+
247+
{{< /tab >}} {{< tab tabNum="6" >}}
248+
249+
```ruby
250+
251+
# For complete examples and data files, please go to https://github.com/groupdocs-viewer-cloud/groupdocs-viewer-cloud-ruby-samples
252+
require 'groupdocs_viewer_cloud'
253+
254+
$client_id = "XXXX-XXXX-XXXX-XXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
255+
$client_secret = "XXXXXXXXXXXXXXXX" # Get ClientId and ClientSecret from https://dashboard.groupdocs.cloud
256+
257+
config = Configuration.new(client_id, client_secret)
258+
config.api_base_url = "http://localhost:8080"
259+
260+
infoApi = GroupDocsViewerCloud::InfoApi.from_config(config)
261+
262+
result = infoApi.get_supported_file_formats()
263+
264+
```
265+
266+
{{< /tab >}} {{< /tabs >}}
267+
152268
### Enable Google Cloud Storage
153269

154270
By default, a local storage used inside container for file operations. It's possible to connect a Google Cloud storage by setting GOOGLE_APPLICATION_CREDENTIALS and GOOGLE_STORAGE_BUCKET environment variables.

0 commit comments

Comments
 (0)