> ## Documentation Index
> Fetch the complete documentation index at: https://superofficeas-worktree-351-fix-webapi-escaped-anchors.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a contact through the services layer

> How to get a Contact through Services layer.

This is an alternative to retrieving a `Contact` entity [through the entities layer][1].

The following example shows how it is done.

## Code

```csharp theme={null}
using SuperOffice.CRM.Services;
using SuperOffice;
using(SoSession mySession = SoSession.Authenticate("SAL0", ""))
{
  //Create a Contact Agent
  ContactAgent myContactAgent = new ContactAgent();

  //Get a Contact Entity through the Contact Agent
  Contact myContact = myContactAgent.GetContact(4);

  //Retrieving the Name Property of the Contact
  string name = myContact.Name;
}
```

## Walk-through

First, you need to create a `ContactAgent`. Then we can retrieve a `Contact` entity carrier by passing the `Contact_id` to the `GetContact` method. At this moment, all the properties of this particular contact will be passed to memory from the database. Now you can access all the properties of this contact via this newly created `Contact` carrier.

[1]: ../../../entities/howto/company/get-contact-via-entities-layer
