Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

240
Vistas
Are there any public API (s) that I could use to verify an activation code?

I am trying to create a product verification system, and I have the login part down. My question is how are there any API (s) that can verify something like an activation code and return if it succeeded or not. Btw, you might have to scroll horizontally to see all of the code

//How would I add a verification system
document.getElementById('redeemButton').addEventListener('click', () => {
  var code = document.getElementById('redeemCodeBox').value;
  var product = document.getElementById('productCode').value;

  const fetchPromise = fetch(`https://www.mywebsite.com/api/redeem?product=${product}&code=${code}`);

fetchPromise.then( response => {
    if (!response.ok) {
      throw new Error(`HTTP error: ${response.status}`);
    }
    return response.json();
  })
  
  .then( json => {
    console.log(json[0].name);
  })
  
  .catch( error => {
    console.error(`Could not get products: ${error}`);
    throw `Please Enter a Valid Activation Code`;
  });
});
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I don't think you should be dependent on a third party to verify an Activation Code.

You should use a combination of JWT token + activation code that you store in the database.

  1. Generate an activation code.

  2. Generate JWT token.

    const token = await this.jwtService.sign( { usetId: userId }, { expiresIn: "1d" } );

  3. Save the activation code and the JWT token to the database.

  4. Send an E-mail or SMS with an activation code to the user. + include URL where user can insert the activation code.

URL can look something like this:

https://www.mywebsite.com/api/activation?token=eyJhbGciOiJIfasdfas

(use query parameter for JWT token =>> ?token=JWT_token

  1. Verify JWT token from URL (value from query parameter "token") and validate if Token is not expired.

  2. Control if user input matches an Activation code stored in your database.

  3. Activated

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda