Skip to content
Snippets Groups Projects
Commit cd932cc6 authored by Klaus Fischer's avatar Klaus Fischer
Browse files

Updated documentation

parent 7b582665
No related branches found
No related tags found
1 merge request!3Feature/440 mvp net sdk part 1
......@@ -7,17 +7,79 @@ FitConnect API and a fluent API.
## All in one
For not having to deal with the low-level API, the SDK provides a high-level support. This is
done by the [All in one](./all_in_one.md) class.
For not having to deal with the low-level API, the SDK provides a high-level support.
### Sender
```mermaid
flowchart TD
client([Create a new FitConnect client])
send.submission[Create new Submission]
send.send[Send the submission]
send.return[\Return the result/]
client-->send.submission-->send.send-->send.return
subscribe.request[Request submissions]
client-->subscribe.request-->ToBeDefined
```
Simplified call:
```csharp
bool SendSubmission(Submission submission){
var client = new Client(...);
return client.SendSubmissionAsync(submission);
}
```
### Subscriber
### Example
Visit [All in one](./all_in_one.md) to see the code.
## Fluent Api
[Fluent Api](./fluent_api.md)
### Sender
```mermaid
flowchart TD
client([Create a new FitConnect client])
Sender[Call the Sender interface]
Authenticate
CreateSubmission
UploadAttachments
SendSubmission
client-->Sender-->Authenticate-->CreateSubmission-->UploadAttachments-->SendSubmission
```
### Subscriber
```mermaid
flowchart TD
client([Create a new FitConnect client])
subscriber[Call the Subscriber interface]
get.submission["GetSubmissions(submissionId)"]
confirm[\Confirm the submission/]
client-->subscriber-->authenticate-->PollSubmissions
authenticate-->GetSubmissions
authenticate-->get.submission-->GetAttachments-->DecryptAttachments-->DecryptData-->DecryptMetadata-->confirm
```
#### Polling available submissions
#### Receiving list of submissions
#### Receiving specific submission
[Fluent Api Example](./fluent_api.md)
## Detailed calls
[Detailed calls](./detailed_calls.md)
## Examples
[Examples](./example.md)
# Example
## Sender
```csharp
client.Sender
.Authenticate(clientId!, clientSecret!)
.CreateSubmission(new Submission { Attachments = new List<Attachment>() })
.UploadAttachments()
.SendSubmission(new Metadata(), new Data());
```
## Subscriber
### Polling available submissions
```csharp
client.Subscriber
.Authenticate(clientId!, clientSecret!)
.PollSubmissions("destinationId", out var _)
```
### Getting list of submissions
```csharp
client.Subscriber
.Authenticate(clientId!, clientSecret!)
.GetSubmissions("destinationId", out var _)
```
### Reading specific submission
```csharp
void FluentSenderCall() {
var client =
new Client(FitConnectEndpoints.Create(FitConnectEndpoints.EndpointType.Development),
logger: _logger);
client.Sender
.Authenticate(clientId, clientSecret)
.CreateSubmission(new Submission())
.UploadAttachments(new List<Attachment>())
.SendSubmission(new Metadata(), new Data());
}
client.Subscriber
.Authenticate(clientId!, clientSecret!)
.GetSubmission("destinationId", "submissionId", out var _)
.GetAttachments(out var _)
.DecryptAttachments(out var _)
.DecryptData(out var _)
.DecryptMetadata(out var _)
.ConfirmSubmission();
```
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment