Skip to content

Commit

Permalink
Add link to Migration docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Arthur Flageul authored and ArthurFlag committed Sep 7, 2021
1 parent 96d226f commit 7cea788
Showing 1 changed file with 12 additions and 70 deletions.
82 changes: 12 additions & 70 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# TalonOne - the C# library for the Talon.One API

The Talon.One API is used to manage applications and campaigns, as well as to
integrate with your application. The operations in the _Integration API_ section
are used to integrate with our platform, while the other operations are
used to manage applications and campaigns.
Use the Talon.One API to integrate with your application and to
manage applications and campaigns:

### Where is the API?
- Use the operations in the [Integration API section](#integration-api)
are used to integrate with our platform
- Use the operation in the [Management API section](#management-api) to
manage applications and campaigns.

The API is available at the same hostname as these docs. For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`, the URL for the [updateCustomerProfile][] operation is `https://mycompany.talon.one/v1/customer_profiles/id`
## Determining the base URL of the endpoints

[updateCustomerProfile]: #operation- -v1-customer_profiles- -integrationId- -put
The API is available at the same hostname as your Campaign Manager deployment.
For example, if you are reading this page at `https://mycompany.talon.one/docs/api/`,
the URL for the [updateCustomerSession](https://docs.talon.one/integration-api/#operation/updateCustomerSessionV2) endpoint
is `https://mycompany.talon.one/v2/customer_sessions/{Id}`


This C# SDK is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
Expand Down Expand Up @@ -57,7 +61,7 @@ using TalonOne.Model;

### Integration API

#### V2
**Note:** The Integration API's V1 `Update customer session` and `Update customer profile` endpoints are now deprecated. Use their V2 instead. See [Migrating to V2](https://docs.talon.one/docs/dev/tutorials/migrating-to-v2) for more information.

```csharp
using System.Collections.Generic;
Expand Down Expand Up @@ -169,68 +173,6 @@ namespace Example
}
```

#### V1

```csharp
using System.Collections.Generic;
using System.Diagnostics;
using TalonOne.Api;
using TalonOne.Client;
using TalonOne.Model;

namespace Example
{
public class Example
{
public static void Main()
{
// Configure BasePath & API key authorization: api_key_v1
var integrationConfig = new Configuration {
BasePath = "https://mycompany.talon.one",
ApiKey = new Dictionary<string, string> {
{ "Authorization", "e18149e88f42205432281c9d3d0e711111302722577ad60dcebc86c43aabfe70" }
},
ApiKeyPrefix = new Dictionary<string, string> {
{ "Authorization", "ApiKey-v1" }
}
};

// Or via the "global" Default configuration:
// Configuration.Default.BasePath = "https://mycompany.talon.one";
// Configuration.Default.AddApiKey("Authorization", "YOUR_API_KEY");
// Configuration.Default.AddApiKeyPrefix("Authorization", "ApiKey-v1");
// ************************************************
// Integration API example to send a session update
// ************************************************
// When using the default approach, the next initiation of `IntegrationApi`
// could be using the empty constructor
var integrationApi = new IntegrationApi(integrationConfig);
var customerSessionId = "my_unique_session_integration_id"; // string | The custom identifier for this session, must be unique within the account.
var customerSessionPayload = new NewCustomerSession {
ProfileId = "unique_profile_integration_id",
State = NewCustomerSession.StateEnum.Open, // `Open` would be the default value anyway
Total = (decimal)42.234
};

try
{
// Create/update a customer session using `UpdateCustomerSession` function
IntegrationState response = integrationApi.UpdateCustomerSession(customerSessionId, customerSessionPayload);
Debug.WriteLine(response);
}
catch (ApiException e)
{
Debug.Print("Exception when calling IntegrationApi.UpdateCustomerSession: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
```

## Management API

```csharp
Expand Down

0 comments on commit 7cea788

Please sign in to comment.