Recherches récentes
Pas de recherche récente

Tatsuya Ogasawara
Adhésion le 03 févr. 2022
·
Dernière activité le 13 nov. 2024
Suivis
0
Abonnés
0
Activité totale
2
Votes
0
Abonnement
1
APERÇU DES ACTIVITÉS
BADGES
ARTICLES
PUBLICATIONS
COMMENTAIRES DE LA COMMUNAUTÉ
COMMENTAIRES SUR L’ARTICLE
APERÇU DES ACTIVITÉS
Dernière activité effectuée par Tatsuya Ogasawara
Tatsuya Ogasawara a créé une publication,
I am a developer working on a Zendesk app that we provide to our customers. In this post, I would like to ask about an issue occurring in one of our customer's environments.
We have a function that creates a user based on a given phone number and returns the user ID. Here is an example of the function:
export const createNewUser = async (phoneNumber: string) => {
const data: ZendeskApiUserCreate = {
user: {
name: phoneNumber,
phone: phoneNumber,
verified: true,
},
};
const options: ZendeskApiOptions = {
url: "/api/v2/users.json",
type: "POST",
contentType: "application/json",
data: JSON.stringify(data),
};
const response = await client.request(options);
return response?.user?.id;
};
When passing a string like 0901234567
to the phoneNumber
parameter of this createNewUser
function, it works fine in most Zendesk instances. However, in a specific customer's instance, we encounter the following error:
{
“readyState”: 4,
“responseJSON”: {
“error”: “RecordInvalid”,
“description”: “Record validation errors”,
“details”: {
“phone”: [
{
“description”: “Phone 09012345678のフォーマットを確認してください。正しい国際電話番号E.164は、国番号、通常は地域番号、および契約者番号から構成されます。例: +1 (555) 123-4567。“,
“error”: “InvalidFormat”
}
]
}
},
“responseText”: “{\“error\“:\“RecordInvalid\“,\“description\“:\“Record validation errors\“,\“details\“:{\“phone\“:[{\“description\“:\“Phone 09012345678のフォーマットを確認してください。正しい国際電話番号E.164は、国番号、通常は地域番号、および契約者番号から構成されます。例: +1 (555) 123-4567。\“,\“error\“:\“InvalidFormat\“}]}}“,
“status”: 422,
“statusText”: “error”
}
Interestingly, in my development instance (d3v environment), I was able to create a user even when using a phone number string like "!-'~'()$%&_=^|[]{};:,<>@"
without encountering any errors.
Is this problem caused by a difference in some specific configuration of the customer's instance? Or could there be another possible reason for this behavior?
Any insights would be greatly appreciated. Thank you in advance for your help.
Modification le 13 nov. 2024 · Tatsuya Ogasawara
0
Abonnés
2
Votes
1
Commentaire