Jump to content

API Rest: Tentando Extrair Conteúdo de Variável API em JavaScript


Recommended Posts

ola pessoal, sou novo no mundo de javascript, e estou tendo um problema no retorno de uma api, onde eu gostaria de pegar somente o conteúdo de uma variável 

vou postar aqui e coloca seu retorno.  para ficar mais claro.

mas no retorno dentro da variavel lo ele me traz toda a tag, gostaria de retirar dela somente oque preciso

 

const main = async() => {
    const response = await callServiceApiRest();
    OUTPUTS.log(`Integration with api rest - ${CUSTOMER_ID} - ${JSON.stringify(response, null, 2)}`); // Success log
    user.set(BM_RESULT_VAR_NAME, JSON.stringify(response));
};

main()
    .catch((err) => {
        // Code on error
        const errorMessage = `[Integration with api rest] :  Error - ${CUSTOMER_ID} - ${err.message}`;
        user.set('ca_error', errorMessage);
        OUTPUTS.log(errorMessage);
    })
    .finally(result.done);

 

  • Curtir 1
Link to comment
Share on other sites

  • Douglas Garcia changed the title to API Rest: Tentando Extrair Conteúdo de Variável API em JavaScript

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...