Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Contributor Claudio Sanches

    (@claudiosanches)

    The signature is invalid, read the docs in order to generate a correct signature: https://woothemes.github.io/woocommerce-rest-api-docs/#index

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Eu dei uma boa lida na documenta??o e encontrei mais dúvidas do que respostas.

    Estou procurando cursos e videos para aprender sobre API REST no Woocommerce, mas ainda n?o tem muito material na internet.

    Estou com mais dificuldade na parte de autentica??o por Oauth. Percebi que n?o basta somente criar as chaves do usuário e tentar acessar por requisi??o http como mostrei acima.

    Espero que vocês consigam me ajudar por aqui como tenho solicitado.

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    How the API works is pretty self-explanatory – it sounds like you are just having trouble with the oauth. If you site has an SSL certificate it is a lot easier to connect to than using OAuth 1.0a for http.

    Maybe try one of the official libraries for the authentication? https://woothemes.github.io/woocommerce-rest-api-docs/#libraries-and-tools

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Boa tarde, sou novo no WordPress e gostaria de saber como adicionar bibliotecas no Woocommerce.

    é só colocar a arquivo da biblioteca em alguma pasta? Qual pasta?

    Obrigado.

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Estou usando o postman para fazer as requisi??es http.

    Tem algum exemplo que eu posso usar para trazer os dados de pedidos através do Postman ou n?o é possível?

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    What exactly are you trying to do with the API? You don’t need to bring those libraries into WooCommerce.

    They work independently in your own app that is querying the api.

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Eu quero listar todos os pedidos do site. Mas estou tentando trazer os dados através usando cURL para testes. Como estou testando, ainda n?o criei nenhum dos arquivos de biblioteca.

    é possível fazer testes usando apenas cURL?

    exemplo:

    curl https://hospedamidia.com.br/redmaxloja/wp-json/wc/v1/orders?oauth_consumer_key=minha_consumer_key&oauth_timestamp=1469820869&oauth_nonce=HtGdhW&oauth_signature=pvyfVEkSuXASoXC8jaoYjud8sDg%3D&oauth_signature_method=HMAC-SHA1

    Se eu n?o conseguir trazer os dados apenas através do curl e precisar usar a biblioteca, em que pasta do meu site eu devo colocar os arquivos?

    Caleb Burks

    (@icaleb)

    Automattic Happiness Engineer

    Yes, that is how the web api works. You don’t put a library in your site folders – the authentication libraries are used within your own external application.

    I don’t mean to sound rude, but it seems like you aren’t in full understanding of how to use a Rest API. Also, what you are using it for doesn’t make much sense.

    You should get in contact with a developer that can help you with your development needs. We can’t help you build a custom application here.

    https://jobs.wordpress.net/
    https://codeable.io/

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Entendi. Vou estar trabalhando para criar uma aplica??o externa e usar as bibliotecas como você mencionou.

    Obrigado.

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Bom dia, eu consegui trazer os dados com sucesso!

    Agora quero trazer os dados no formato Json. Vi em alguns fóruns que devo usar json_encode(), mas n?o sei bem onde devo colocar no meu código.

    Podem me ajudar?

    Minha classe:

    <?php
    require_once ‘class-wc-api-client.php’;

    $consumer_key = ‘ck_123’; // Adicionar Consumer Key aqui
    $consumer_secret = ‘cs_123’; // Adicionar Consumer Secret aqui
    $store_url = ‘https://www.lojaredmax.com.br/&#8217;; // Adicionar endere?o do site

    $options = array(
    ‘debug’ => true,
    ‘return_as_array’ => false,
    ‘validate_url’ => false,
    ‘timeout’ => 30,
    ‘ssl_verify’ => false,
    );

    // Inicializando a classe
    $wc_api = new WC_API_Client( $consumer_key, $consumer_secret, $store_url );

    // Trazer Pedido por ID
    $test = ( $wc_api->get_order ( 2016 ) );

    print_r($test);

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Thread Starter Excelent Mídia

    (@glebersoninacio)

    Achei a solu??o. Para quem precisar futuramente, ai está:

    $test = json_encode( $wc_api->get_order ( 2016 ) );

    print_r($test);

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Now I want to bring the data in JSON format. I saw in some forums that I use json_encode (), but I do not know where should I put in my code .

    Can you help me?

    The REST API returns JSON by default.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘woocommerce_rest_authentication_error’ is closed to new replies.