diff --git a/README.md b/README.md index 18786bd..526c16e 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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; @@ -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 { - { "Authorization", "e18149e88f42205432281c9d3d0e711111302722577ad60dcebc86c43aabfe70" } - }, - ApiKeyPrefix = new Dictionary { - { "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