You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The POST /notifications/api/v1/orders endpoint does not properly handle invalid characters in the mobileNumber field. For example, submitting a value like "+47invalidChar" results in an internal server error (500) without providing a meaningful error message to the user.
Steps to Reproduce
Send a POST request to the /notifications/api/v1/orders endpoint with a mobileNumber field containing invalid characters (e.g., "+47invalidChar").
Observe that the API responds with an internal server error (500) instead of rejecting the request with a meaningful validation error message.
Example Request:
{
"notificationChannel": "Sms",
"smsTemplate": {
"senderNumber": "+4746269164",
"body": "Hei, Du har en ny melding i Altinn."
},
"sendersReference": "907c8054-b2cc-4dca-b4df-c95b89860762",
"recipients": [
{
"mobileNumber": "+47invalidChar"
}
]
}
Expected Behavior
The API should validate the mobileNumber field to ensure it adheres to valid international phone number format standards. If invalid characters are submitted, the API should reject the request with a descriptive error message, such as "Invalid mobile number format," preventing further processing.
Suggested Fix
Introduce or improve input validation on the mobileNumber field to ensure it only accepts valid numeric characters following international phone number standards. When validation fails, return a clear and informative error message, rejecting the request before it reaches internal processing.
Acceptance criteria:
Validation-scheme documented at docs.altinn.studio
Failed validations give response-code 400 and a message (e.g. "mobileNumber format not adhering to...")
The text was updated successfully, but these errors were encountered:
Ahmed-Ghanam
changed the title
Invalid Characters Allowed in mobileNumber Field of /notifications/api/v1/orders Endpoint
Invalid Characters allowed in mobileNumber Field of /notifications/api/v1/orders Endpoint
Sep 26, 2024
Ahmed-Ghanam
changed the title
Invalid Characters allowed in mobileNumber Field of /notifications/api/v1/orders Endpoint
Invalid characters allowed in mobileNumber Field of /notifications/api/v1/orders Endpoint
Sep 27, 2024
Updating issue to be "adhere to validation standard + document this", to avoid confusion on permitted content. Feiled validations should give 400 and a sensible message.
Skjønner, siste klarering da: Jeg får 400 bad request på visse telefonnumre og formater, kan du si hvilken standard dere bruker for å validere gyldige numre?
Ut ifra testingen min så virker det til å være E.164
Description
The
POST /notifications/api/v1/orders
endpoint does not properly handle invalid characters in themobileNumber
field. For example, submitting a value like"+47invalidChar"
results in an internal server error (500) without providing a meaningful error message to the user.Steps to Reproduce
POST
request to the/notifications/api/v1/orders
endpoint with amobileNumber
field containing invalid characters (e.g.,"+47invalidChar"
).Example Request:
Expected Behavior
The API should validate the
mobileNumber
field to ensure it adheres to valid international phone number format standards. If invalid characters are submitted, the API should reject the request with a descriptive error message, such as "Invalid mobile number format," preventing further processing.Suggested Fix
Introduce or improve input validation on the
mobileNumber
field to ensure it only accepts valid numeric characters following international phone number standards. When validation fails, return a clear and informative error message, rejecting the request before it reaches internal processing.Acceptance criteria:
The text was updated successfully, but these errors were encountered: