Skip to content

Latest commit

 

History

History
653 lines (529 loc) · 18.4 KB

AgentsApi.md

File metadata and controls

653 lines (529 loc) · 18.4 KB

CloselinkAPI.Api.AgentsApi

All URIs are relative to https://public-api.closelink.net

Method HTTP request Description
CreateAgent POST /v1/agents Create agent
CreateAgentBulk POST /v1/agents/bulk Create multiple agents
FindAgentByExternalId GET /v1/agents/external/{externalId} Find agent by external ID
FindAgentById GET /v1/agents/{id} Find agent by ID
FindAgents GET /v1/agents Find agents
UpdateAgent PUT /v1/agents/{id} Update agent
UpdateAgentBulk PUT /v1/agents/bulk Update multiple agents
UpdateAgentByExternalId PUT /v1/agents/external/{externalId} Update agent by external ID

CreateAgent

AgentMessage CreateAgent (AgentMessage body)

Create agent

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var body = new AgentMessage(
                        "Agent 1",
                        new AddressMessage(
                            "Street",
                            "1",
                            "12344",
                            "Hamburg",
                            "Germany"
                        ),
                        new ContactMessage(
                            "Joe Doe",
                            "+49 5454 45 45 4",
                            "[email protected]",
                            "+49 45 5454 554 5"
                        ),
                        new List<string> { "loCode1", "loCode2" },
                        "Note 1",
                        "customerId1"
                    ); 

            try
            {
                // Create agent
                ApiResponse<AgentMessage> response = apiInstance.CreateAgent(body);
                Console.WriteLine("StatusCode: " + response.StatusCode);
                Console.WriteLine(response.Data); 
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.CreateAgent: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body AgentMessage

Return type

AgentMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CreateAgentBulk

AgentsMessage CreateAgentBulk (AgentsMessage body)

Create multiple agents

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var body = new AgentsMessage(
                new List<AgentMessage>{
                    new AgentMessage(
                        "Agent 1",
                        new AddressMessage(
                            "Street",
                            "1",
                            "12344",
                            "Hamburg",
                            "Germany"
                        ),
                        new ContactMessage(
                            "Joe Doe",
                            "+49 5454 45 45 4",
                            "[email protected]",
                            "+49 45 5454 554 5"
                        ),
                        new List<string> { "loCode1", "loCode2" },
                        "Note 1",
                        "customerId1"
                    ),
                    new AgentMessage(
                        "Agent 2",
                        new AddressMessage(
                            "Street",
                            "2",
                            "25654",
                            "Hamburg",
                            "Germany"
                        ),
                        new ContactMessage(
                            "Joe Doe",
                            "+49 5454 45 45 4",
                            "[email protected]",
                            "+49 45 5454 554 5"
                        ),
                        new List<string> { "loCode1", "loCode2" },
                        "Note 2",
                        "customerId2"
                    )
                });

            try
            {
                // Create multiple agents
                ApiResponse<AgentsMessage> response = apiInstance.CreateAgentBulk(body);
                Console.WriteLine("StatusCode: " + response.StatusCode);
                response.Data.Agents.ForEach(Console.WriteLine);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.CreateAgentBulk: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body AgentsMessage

Return type

AgentsMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindAgentByExternalId

AgentMessage FindAgentByExternalId (string externalId)

Find agent by external ID

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var externalId = "externalId1"; 

            try
            {
                // Find agent by external ID
                ApiResponse<AgentMessage> response = apiInstance.FindAgentByExternalId(externalId);
                Console.WriteLine(response.StatusCode);
                Console.WriteLine(response.Data); 
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.FindAgentByExternalId: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
externalId string

Return type

AgentMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindAgentById

AgentMessage FindAgentById (string id)

Find agent by ID

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var id = id_example;  // string | 

            try
            {
                // Find agent by ID
                ApiResponse<AgentMessage> response = apiInstance.FindAgentById(id);
                Console.WriteLine(response.StatusCode);
                Console.WriteLine(response.Data); 
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.FindAgentById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string

Return type

AgentMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

FindAgents

AgentsMessage FindAgents (List customerIds, string searchQuery, List loCodes)

Find agents

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();

            try
            {
                // Find agents
                ApiResponse<AgentsMessage> response = apiInstance.FindAgents();
                Console.WriteLine("StatusCode: " + response.StatusCode);
                response.Data.Agents.ForEach(Console.WriteLine);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.FindAgents: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
customerIds List<string> List of customer IDs [optional]
searchQuery string Search query [optional]
loCodes List<string> List of port IDs [optional]

Return type

AgentsMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateAgent

AgentMessage UpdateAgent (string id, AgentMessage body)

Update agent

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var id = "id1";
            var body = new AgentMessage(
                "Agent 1",
                new AddressMessage(
                    "Street",
                    "1",
                    "12344",
                    "Hamburg",
                    "Germany"
                ),
                new ContactMessage(
                    "Joe Doe",
                    "+49 5454 45 45 4",
                    "[email protected]",
                    "+49 45 5454 554 5"
                ),
                new List<string> { "loCode1", "loCode2" },
                "Note 1",
                "customerId1"
            );

            try
            {
                // Update agent
                ApiResponse<AgentMessage> response = apiInstance.UpdateAgent(id, body);
                Console.WriteLine(response.StatusCode);
                Console.WriteLine(response.Data); 
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.UpdateAgent: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
id string Agent ID
body AgentMessage

Return type

AgentMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateAgentBulk

AgentsMessage UpdateAgentBulk (AgentsMessage body)

Update multiple agents

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var body = return new AgentsMessage(
                new List<AgentMessage>{
                    new AgentMessage(
                        "Agent 1",
                        new AddressMessage(
                            "Street",
                            "1",
                            "12344",
                            "Hamburg",
                            "Germany"
                        ),
                        new ContactMessage(
                            "Joe Doe",
                            "+49 5454 45 45 4",
                            "[email protected]",
                            "+49 45 5454 554 5"
                        ),
                        new List<string> { "loCode1", "loCode2" },
                        "Note 1",
                        "customerId1",
                        "externalId1"
                    ),
                    new AgentMessage(
                        "Agent 2",
                        new AddressMessage(
                            "Street",
                            "2",
                            "25654",
                            "Hamburg",
                            "Germany"
                        ),
                        new ContactMessage(
                            "Joe Doe",
                            "+49 5454 45 45 4",
                            "[email protected]",
                            "+49 45 5454 554 5"
                        ),
                        new List<string> { "loCode1", "loCode2" },
                        "Note 2",
                        "customerId2",
                        "externalId1"
                    )
                });

            try
            {
                // Update multiple agents
                ApiResponse<AgentsMessage> response = apiInstance.UpdateAgentBulk(body);
                Console.WriteLine("StatusCode: " + response.StatusCode);
                response.Data.Agents.ForEach(Console.WriteLine);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.UpdateAgentBulk: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
body AgentsMessage

Return type

AgentsMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateAgentByExternalId

AgentMessage UpdateAgentByExternalId (string externalId, AgentMessage body)

Update agent by external ID

Example

using System;
using CloselinkAPI.Api;
using CloselinkAPI.Client;
using CloselinkAPI.Model;

namespace Example
{
    class Program
    {
        static void Main(string[] args)
        {
            // Configure API key authorization
            Configuration.Default.ApiKey = "YOUR_API_KEY";

            var apiInstance = new AgentsApi();
            var externalId = "externalId1";
            var body = new AgentMessage(
                    "Agent 1",
                    new AddressMessage(
                        "Street",
                        "1",
                        "12344",
                        "Hamburg",
                        "Germany"
                    ),
                    new ContactMessage(
                        "Joe Doe",
                        "+49 5454 45 45 4",
                        "[email protected]",
                        "+49 45 5454 554 5"
                    ),
                    new List<string> { "loCode1", "loCode2" },
                    "Note 1",
                    "customerId1"
                );

            try
            {
                // Update agent by external ID
                ApiResponse<AgentMessage> response = apiInstance.UpdateAgentByExternalId(externalId, body);
                Console.WriteLine(response.StatusCode);
                Console.WriteLine(response.Data); 
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception when calling AgentsApi.UpdateAgentByExternalId: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
externalId string
body AgentMessage

Return type

AgentMessage

Authorization

apikey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]