OTP USSD Code: Retrieve a Missed SMS OTP in Ghana

OTP USSD Code: Retrieve a Missed SMS OTP in Ghana

Phone verification screen showing a prompt to dial an OTP USSD code and view a missed SMS OTP, for Ghanaian numbers only

When a one-time password (OTP) doesn’t reach your user, Arkesel gives you two ways to get them through verification. Your user can dial an OTP USSD code to view a code that was sent to them by SMS, and your app can resend the code, choosing a voice call on the request for Ghanaian numbers.

Both options depend on the country of the number you’re verifying, so it pays to know which one applies before you design your verification screen.

How does the OTP USSD code work?

USSD is the type of short code you dial from your phone’s keypad, ending with a hash. With Arkesel, a user who was sent an OTP by SMS but did not receive it can dial a USSD code to view it. The option to retrieve OTP by USSD works for Ghanaian numbers only.

Only the phone that received the OTP can see it this way. The Arkesel API specification states that the OTP generate response includes a USSD code the recipient can dial to check the OTP, and the code is accessible only to the phone number that received it.

That matters for security. Someone who knows your user’s phone number but doesn’t hold the phone can’t use retrieval to read the code.

The current dial code is published in the OTP API documentation, and it can change. Your integration receives it in the response to each OTP request, so you always have the current one.

How is USSD retrieval different from resending the OTP?

The two options solve the same problem from opposite ends. Retrieval is something your user does. A resend is something your app does.

It helps to know what Arkesel doesn’t do for you. There is no automatic OTP fallback: you choose SMS or voice on each request, a failed SMS is not retried by voice, and nothing is sent by USSD.

With retrieval, the user takes the step. They see a prompt on your verification screen, dial the USSD code on the phone the OTP was sent to, and read their code.

With a resend, your app takes the step. It makes a new OTP request, by SMS again or, for a Ghanaian number, with voice as the medium so the code arrives as a call.

Keeping the two apart helps you design the screen honestly:

  • Resending is your app’s logic. Offer a “resend code” option, and for Ghanaian numbers you can add “call me instead”, which sends the new request with the medium parameter set to voice. If you want a call to follow a failed SMS without the user asking, that retry is something you build yourself.
  • Retrieval needs your interface. If you don’t show the prompt, your users won’t know the option exists.

Which OTP options apply in each country?

When a user reports “OTP not received”, what you can offer depends on where their number is registered. Voice OTP is Ghana only: Nigerian, South African and Tanzanian numbers get OTP by SMS only.

CountryOTP by SMSOTP by voice (when you request it)USSD retrieval
GhanaYesYesYes
NigeriaYesNoNo
South AfricaYesNoNo
TanzaniaYesNoNo

Two points follow for your build. Show the retrieval prompt and the “call me instead” option to Ghanaian numbers only. For Nigerian, South African and Tanzanian users, the route forward when a code doesn’t arrive is a resend by SMS, so make that option easy to find.

If you’re verifying Ghanaian users, our page on phone number verification in Ghana sets out the local product details.

How do you add OTP retrieval to your verification screen?

When you generate an OTP through the API, you set the delivery medium to SMS or voice on the request. Voice applies to Ghanaian numbers only. Arkesel sends the code, and the response to that request carries the USSD retrieval code.

Here is the flow to build:

  1. Send the OTP. Send a request to the OTP generate endpoint, api/otp/generate on sms.arkesel.com. Set medium on every request: sms, or voice if you want a call and the number is Ghanaian.
  2. Read the OTP USSD code from the response. The generate response returns it in the ussd_code field. Take it from the response every time rather than hard-coding a dial code into your app, because the code can change.
  3. Show a short prompt to Ghanaian users. Place it under the code entry field, where the user looks when nothing has arrived.
  4. Let the user verify as normal. A code the user views by USSD is the same OTP, so they enter it in the same field.

Prompt copy and timing

A prompt can be as short as this:

“Didn’t get your code? Dial [ussd_code value from the API response] on this phone to view it.”

Keep the words “on this phone” in your copy. Retrieval only works from the number the OTP was sent to, so a user can’t view it from another number.

Timing is worth planning too. Arkesel OTPs can be 6 to 15 digits long with an expiry window of 1 to 10 minutes, so show the prompt while the user is still on the verification screen rather than in a follow-up email or a later session.

For the full request and response format, go to the OTP API documentation.

Benefits of offering a second route to the OTP

SMS messages and calls sometimes don’t arrive. When that happens on a sign-up or login screen, the user has few options: request another code, wait, or leave.

A visible retrieval prompt gives your Ghanaian users one more thing to try on the spot, without you sending the code to a new destination such as an email address.

It also takes little extra work. The retrieval code already comes back in the OTP generate response, so your team adds a line of interface copy and reads one value from a response you already handle.

If codes aren’t arriving for reasons in your own setup, such as request errors, our guide to common OTP API errors covers the fixes. For background on the codes themselves, see how one-time passwords work.

Documentation

The OTP API documentation holds the current OTP USSD code, the generate and verify endpoints, and the full response format. Treat it as the source for anything your code depends on.

For questions about your account or how these features apply to your users, email support@arkesel.com.

Conclusion

An OTP that doesn’t arrive shouldn’t end a sign-up. Your app can resend the code, by voice for Ghanaian numbers if you choose, and your Ghanaian users can view their code by USSD from the phone it was sent to when you show them how.

Add Arkesel Phone Number Verification to your app, or create your Arkesel account and start sending OTPs today.

Scroll to Top