# API - Foreign Languages

**URL:** <https://community.hubspot.com/t/api-foreign-languages/20851>\
**Category:** APIs & Integrations\
**Tags:** contacts\
**Created:** [May 13, 2020, 9:08pm UTC](https://community.hubspot.com/t/api-foreign-languages/20851 "2020-05-13T21:08:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rarayav](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rarayav/32/77060_2.png) [@rarayav](https://community.hubspot.com/u/rarayav)\
**Post date:** [May 13, 2020, 9:08pm UTC](https://community.hubspot.com/t/api-foreign-languages/20851/1 "2020-05-13T21:08:44Z")

</div>

Hi,  
Whenever we try to Create/Update a contact using the API to a contact whois name/last name is in foreign language, we get a 400 Bad Request error.

How should we encode that? or deal with the issue?

I try with UTF8Encoding C#

Example: Villalón

Thanks!

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [May 15, 2020, 2:33am UTC](https://community.hubspot.com/t/api-foreign-languages/20851/2 "2020-05-15T02:33:45Z")

</div>

Hey @rarayav,

It doesn’t appear that HubSpot does encoding on our end. I made a simple POST request to this [endpoint]([http://Create](http://Create)%20a new contact | Contacts API)

POST [https://api.hubspot.com/contacts/v1/contact?hapikey=](https://api.hubspot.com/contacts/v1/contact?hapikey=){{my hapikey}}

with the following POST body

 ![26879i3AA081C9FB32CA9B.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/0/00275a7a3cdcfc1d92c813a8318cdceb325103c7.png)

and I’m able to see the contact name shows up just fine:

 ![26880iAD11D3BA8C2B4B2B.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/e/6/e6b820845f500ae08c614005445805e6bd663e00.png)

---

<div class="post-metadata">

**Author:** ![rarayav](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rarayav/32/77060_2.png) [@rarayav](https://community.hubspot.com/u/rarayav)\
**Post date:** [May 15, 2020, 1:15pm UTC](https://community.hubspot.com/t/api-foreign-languages/20851/3 "2020-05-15T13:15:36Z")

</div>

Could it be that the problem is the api version I am using?  
My code:

string url = “[https://api.hubapi.com/crm/v3/objects/contacts?hapikey={MyApiKey}](https://api.hubapi.com/crm/v3/objects/contacts?hapikey=%7BMyApiKey%7D)”;  
WebRequest myReq = WebRequest.Create(url);  
myReq.Method = “POST”;  
myReq.ContentType = “application/json; charset=utf-8”;  
string data = “{\“properties\”:{ \“lastname\”: \“Villalón\” } }”;

When I remove the accent mark it works, but that doesn’t work for me

---

<div class="post-metadata">

**Author:** ![WendyGoh](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/wendygoh/32/42320_2.png) [@WendyGoh](https://community.hubspot.com/u/WendyGoh)\
**Post date:** [May 18, 2020, 3:30am UTC](https://community.hubspot.com/t/api-foreign-languages/20851/4 "2020-05-18T03:30:09Z")

</div>

Hey @rarayav,

I tried using the v3 endpoint

POST crm/v3/objects/contacts?hapikey={{myhapikey}}

```auto
{
 "properties": {
 "lastname": "Villalón",
"firstname": "18test"
 }
}

```

and I’m seeing that a contact with the last name Villalón was created successfully:

 ![26948iC78E474403F1C53D.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/0/4/04a1cf95dadfcd64e4222c8cd7c151b204768213.png)

Could you try removing the encoding charset=utf-8?

---

<div class="post-metadata">

**Author:** ![rarayav](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/rarayav/32/77060_2.png) [@rarayav](https://community.hubspot.com/u/rarayav)\
**Post date:** [May 18, 2020, 1:35pm UTC](https://community.hubspot.com/t/api-foreign-languages/20851/5 "2020-05-18T13:35:08Z")

</div>

the following worked

(C#)

HttpWebRequest request = (HttpWebRequest)WebRequest.Create(“[https://api.hubapi.com/crm/v3/objects/contacts?hapikey=XXXXXX](https://api.hubapi.com/crm/v3/objects/contacts?hapikey=XXXXXX)”);  
request.Method = “POST”;  
request.Accept = “application/json”;  
request.ContentType = “application/json”;

using (var streamWriter = new StreamWriter(request.GetRequestStream()))  
{  
string data = "{\“properties\”: {\“lastname\”: \“Villalón\”,\“firstname\”: \“19test\”, \“hubspot\_owner\_id\”: \“47664540\”}} ";

streamWriter.Write(data);  
}

var response = request.GetResponse();  
string text;

using (var sr = new StreamReader(response.GetResponseStream()))  
{  
text = sr.ReadToEnd();  
}  
return text;

thank you very much for your help
