{"id":2821,"date":"2021-07-08T12:04:41","date_gmt":"2021-07-08T15:04:41","guid":{"rendered":"https:\/\/help.roicommerce.com.br\/?p=2821"},"modified":"2024-06-25T17:41:25","modified_gmt":"2024-06-25T20:41:25","slug":"api-roi-commerce-2","status":"publish","type":"post","link":"https:\/\/help.roicommerce.com.br\/index.php\/2021\/07\/08\/api-roi-commerce-2\/","title":{"rendered":"API ROI COMMERCE"},"content":{"rendered":"\n<p class=\"eplus-IiWq5R\">M\u00e9todo PHP para acesso aos recursos via PUT<\/p>\n\n\n\n<pre class=\"wp-block-code eplus-NrTikt\"><code>    \n    $token = {token}\n    $empresa = {empresa_id}\n    $endPoint = {\u2026}\n    $data = {\u2026}    \n    $headers = array(\n        \"token: $token\",\n        'Accept: application\/json',\n        'Content-Type: application\/json'\n    );\n\n    $requestString = \"{$endPoint}\";\n\n    $curl = curl_init();\n    \/\/ check if a new cURL was created successfully\n    if (!$curl) {\n        die($this-&gt;getError(500, 'N\u00e3o foi poss\u00edvel inicializar o cURL')); \n    }\n    \/\/ cURL configurations\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n    \/\/ cURL data\n    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"PUT\");\n    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n    curl_setopt($curl, CURLOPT_URL, $this-&gt;getUrl($requestString, $empresa));\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n    $response = trim(curl_exec($curl));\n    $info = curl_getinfo($curl);\n    curl_close($curl);\n\n    return $response;<\/code><\/pre>\n\n\n\n<p class=\"eplus-I85227\">M\u00e9todo PHP para acesso aos recursos via POST<\/p>\n\n\n\n<pre class=\"wp-block-code eplus-r4kdMJ\"><code>    \n    $token = {token}\n    $empresa = {empresa_id}\n    $endPoint = {\u2026}\n    $data = {\u2026}    \n    $headers = array(\n        \"token: $token\",\n        'Accept: application\/json',\n        'Content-Type: application\/json'\n    );\n\n    $requestString = \"{$endPoint}\";\n\n    $curl = curl_init();\n    \/\/ check if a new cURL was created successfully\n    if (!$curl) {\n        die($this-&gt;getError(500, 'N\u00e3o foi poss\u00edvel inicializar o cURL')); \n    }\n    \/\/ cURL configurations\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n    \/\/ cURL data\n    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n    curl_setopt($curl, CURLOPT_URL, $this-&gt;getUrl($requestString, $empresa));\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n    $response = trim(curl_exec($curl));\n    $info = curl_getinfo($curl);\n    curl_close($curl);\n\n    return $response;<\/code><\/pre>\n\n\n\n<p class=\"eplus-iG8xKl\">M\u00e9todo PHP para acesso aos recursos via DELETE<\/p>\n\n\n\n<pre class=\"wp-block-code eplus-haOpOb\"><code>    \n    $token = {token}\n    $empresa = {empresa_id}\n    $endPoint = {\u2026}\n    $data = {\u2026}    \n    $headers = array(\n        \"token: $token\",\n        'Accept: application\/json',\n        'Content-Type: application\/json'\n    );\n\n    $requestString = \"{$endPoint}\";\n\n    $curl = curl_init();\n    \/\/ check if a new cURL was created successfully\n    if (!$curl) {\n        die($this-&gt;getError(500, 'N\u00e3o foi poss\u00edvel inicializar o cURL')); \n    }\n    \/\/ cURL configurations\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n    \/\/ cURL data\n    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"DELETE\");\n    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n    curl_setopt($curl, CURLOPT_URL, $this-&gt;getUrl($requestString, $empresa));\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n    $response = trim(curl_exec($curl));\n    $info = curl_getinfo($curl);\n    curl_close($curl);\n\n    return $response;<\/code><\/pre>\n\n\n\n<p class=\"eplus-MbKSRk\">M\u00e9todo PHP para acesso aos recursos via GET<\/p>\n\n\n\n<pre class=\"wp-block-code eplus-6HTkov\"><code>    \n    $token = {token}\n    $empresa = {empresa_id}\n    $endPoint = {\u2026}\n    $data = {\u2026}    \n    $headers = array(\n        \"token: $token\",\n        'Accept: application\/json',\n        'Content-Type: application\/json'\n    );\n\n    $requestString = \"{$endPoint}\";\n\n    $curl = curl_init();\n    \/\/ check if a new cURL was created successfully\n    if (!$curl) {\n        die($this-&gt;getError(500, 'N\u00e3o foi poss\u00edvel inicializar o cURL')); \n    }\n    \/\/ cURL configurations\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n    \/\/ cURL data\n    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"GET\");\n    curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));\n    curl_setopt($curl, CURLOPT_URL, $this-&gt;getUrl($requestString, $empresa));\n    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n    $response = trim(curl_exec($curl));\n    $info = curl_getinfo($curl);\n    curl_close($curl);\n\n    return $response;<\/code><\/pre>\n\n\n\n<p class=\"eplus-6coVv7\">Para acessar detalhes sobre os recursos da API ROI COMMERCE, clique nos recursos abaixo:<\/p>\n\n\n\n<p class=\"eplus-18cjBK\"><a href=\"https:\/\/help.roicommerce.com.br\/index.php\/2021\/07\/15\/produto-api-roi-commerce\/\" data-type=\"URL\" data-id=\"https:\/\/help.roicommerce.com.br\/index.php\/2021\/07\/15\/produto-api-roi-commerce\/\" target=\"_blank\" rel=\"noreferrer noopener\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de PRODUTOS<\/a><\/p>\n\n\n\n<p class=\"eplus-L8m9PN\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de MARCAS<\/p>\n\n\n\n<p class=\"eplus-XvbCWC\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de CATEGORIAS<\/p>\n\n\n\n<p class=\"eplus-H2dUOo\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de VARIA\u00c7\u00d5ES<\/p>\n\n\n\n<p class=\"eplus-zpfrEZ\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de TIPO VARIA\u00c7\u00d5ES<\/p>\n\n\n\n<p class=\"eplus-2YuSbZ\">Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de ATRIBUTOS<\/p>\n\n\n\n<p class=\"eplus-SxS3fX\">Para acessar a documenta\u00e7\u00e3o sobre os recursos da API ROI COMMERCE, clique nos recursos abaixo:<\/p>\n\n\n\n<p class=\"eplus-3c73TF\"><a href=\"https:\/\/app.swaggerhub.com\/apis-docs\/wjr-digital\/ROI_COMMERCE\/1.0.0\">https:\/\/app.swaggerhub.com\/apis-docs\/wjr-digital\/ROI_COMMERCE\/1.0.0<\/a><a href=\"https:\/\/app.swaggerhub.com\/apis-docs\/wjr-digital\/roi-commerce\/1.0.0\" target=\"_blank\" rel=\"noreferrer noopener\"><br><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>M\u00e9todo PHP para acesso aos recursos via PUT M\u00e9todo PHP para acesso aos recursos via POST M\u00e9todo PHP para acesso aos recursos via DELETE M\u00e9todo PHP para acesso aos recursos via GET Para acessar detalhes sobre os recursos da API ROI COMMERCE, clique nos recursos abaixo: Cadastro, Atualiza\u00e7\u00e3o e Exclus\u00e3o de PRODUTOS Cadastro, Atualiza\u00e7\u00e3o e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2821"}],"collection":[{"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/comments?post=2821"}],"version-history":[{"count":9,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2821\/revisions"}],"predecessor-version":[{"id":4239,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/posts\/2821\/revisions\/4239"}],"wp:attachment":[{"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/media?parent=2821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/categories?post=2821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/help.roicommerce.com.br\/index.php\/wp-json\/wp\/v2\/tags?post=2821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}