326 lines
8.0 KiB
Markdown
326 lines
8.0 KiB
Markdown
# ShareApi
|
|
|
|
All URIs are relative to *http://localhost/api*
|
|
|
|
Method | HTTP request | Description
|
|
------------- | ------------- | -------------
|
|
[**createShare**](ShareApi.md#createShare) | **POST** /shares | Creates a new share.
|
|
[**deleteShare**](ShareApi.md#deleteShare) | **DELETE** /shares/{id} | Delete a share.
|
|
[**getShare**](ShareApi.md#getShare) | **GET** /shares/{id} | Returns a share.
|
|
[**getShareInfo**](ShareApi.md#getShareInfo) | **GET** /shares/{token}/info | Get a share info by its secret token.
|
|
[**getShareLocation**](ShareApi.md#getShareLocation) | **GET** /shares/{token}/location | Get a shared location by its secret token.
|
|
[**setShare**](ShareApi.md#setShare) | **PUT** /shares/{id} | Updates an existing share.
|
|
|
|
|
|
<a name="createShare"></a>
|
|
# **createShare**
|
|
> Share createShare(body)
|
|
|
|
Creates a new share.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiClient;
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.Configuration;
|
|
//import io.swagger.client.auth.*;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
|
|
// Configure API key authorization: device
|
|
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
|
|
device.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//device.setApiKeyPrefix("Token");
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
ShareInfo body = new ShareInfo(); // ShareInfo | Necessary data from to create a share.
|
|
try {
|
|
Share result = apiInstance.createShare(body);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#createShare");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**body** | [**ShareInfo**](ShareInfo.md)| Necessary data from to create a share. |
|
|
|
|
### Return type
|
|
|
|
[**Share**](Share.md)
|
|
|
|
### Authorization
|
|
|
|
[device](../README.md#device)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|
|
<a name="deleteShare"></a>
|
|
# **deleteShare**
|
|
> deleteShare(id)
|
|
|
|
Delete a share.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiClient;
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.Configuration;
|
|
//import io.swagger.client.auth.*;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
|
|
// Configure API key authorization: device
|
|
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
|
|
device.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//device.setApiKeyPrefix("Token");
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
Long id = 789L; // Long | The share id.
|
|
try {
|
|
apiInstance.deleteShare(id);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#deleteShare");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **Long**| The share id. |
|
|
|
|
### Return type
|
|
|
|
null (empty response body)
|
|
|
|
### Authorization
|
|
|
|
[device](../README.md#device)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|
|
<a name="getShare"></a>
|
|
# **getShare**
|
|
> Share getShare(id)
|
|
|
|
Returns a share.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiClient;
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.Configuration;
|
|
//import io.swagger.client.auth.*;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
|
|
// Configure API key authorization: device
|
|
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
|
|
device.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//device.setApiKeyPrefix("Token");
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
Long id = 789L; // Long | The share id.
|
|
try {
|
|
Share result = apiInstance.getShare(id);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#getShare");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **Long**| The share id. |
|
|
|
|
### Return type
|
|
|
|
[**Share**](Share.md)
|
|
|
|
### Authorization
|
|
|
|
[device](../README.md#device)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|
|
<a name="getShareInfo"></a>
|
|
# **getShareInfo**
|
|
> ShareInfo getShareInfo(token)
|
|
|
|
Get a share info by its secret token.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
String token = "token_example"; // String | The secret token.
|
|
try {
|
|
ShareInfo result = apiInstance.getShareInfo(token);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#getShareInfo");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**token** | **String**| The secret token. |
|
|
|
|
### Return type
|
|
|
|
[**ShareInfo**](ShareInfo.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|
|
<a name="getShareLocation"></a>
|
|
# **getShareLocation**
|
|
> Location getShareLocation(token)
|
|
|
|
Get a shared location by its secret token.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
String token = "token_example"; // String | The secret token.
|
|
try {
|
|
Location result = apiInstance.getShareLocation(token);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#getShareLocation");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**token** | **String**| The secret token. |
|
|
|
|
### Return type
|
|
|
|
[**Location**](Location.md)
|
|
|
|
### Authorization
|
|
|
|
No authorization required
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|
|
<a name="setShare"></a>
|
|
# **setShare**
|
|
> Share setShare(id, body)
|
|
|
|
Updates an existing share.
|
|
|
|
|
|
|
|
### Example
|
|
```java
|
|
// Import classes:
|
|
//import io.swagger.client.ApiClient;
|
|
//import io.swagger.client.ApiException;
|
|
//import io.swagger.client.Configuration;
|
|
//import io.swagger.client.auth.*;
|
|
//import io.swagger.client.api.ShareApi;
|
|
|
|
ApiClient defaultClient = Configuration.getDefaultApiClient();
|
|
|
|
// Configure API key authorization: device
|
|
ApiKeyAuth device = (ApiKeyAuth) defaultClient.getAuthentication("device");
|
|
device.setApiKey("YOUR API KEY");
|
|
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
|
|
//device.setApiKeyPrefix("Token");
|
|
|
|
ShareApi apiInstance = new ShareApi();
|
|
Long id = 789L; // Long | The share id.
|
|
Share body = new Share(); // Share | The new share to set.
|
|
try {
|
|
Share result = apiInstance.setShare(id, body);
|
|
System.out.println(result);
|
|
} catch (ApiException e) {
|
|
System.err.println("Exception when calling ShareApi#setShare");
|
|
e.printStackTrace();
|
|
}
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Name | Type | Description | Notes
|
|
------------- | ------------- | ------------- | -------------
|
|
**id** | **Long**| The share id. |
|
|
**body** | [**Share**](Share.md)| The new share to set. | [optional]
|
|
|
|
### Return type
|
|
|
|
[**Share**](Share.md)
|
|
|
|
### Authorization
|
|
|
|
[device](../README.md#device)
|
|
|
|
### HTTP request headers
|
|
|
|
- **Content-Type**: application/json, application/xml
|
|
- **Accept**: application/json, application/xml
|
|
|