SQL Server Woocommerce API connection gives NULL when getting products, works fine with ordersSQL Client for Mac OS X that works with MS SQL ServerGet list of databases from SQL ServerHow can I get column names from a table in SQL Server?OR is not supported with CASE Statement in SQL ServerSQL Server - inner join when updatingPosting to tumblr using API v2 on iOS returning errorUsing Magento REST APIAuthintication Error in Ionic WooCommerce using AngularWhen i try to authenticate oauth1 rest api returnse Invalide_signature errorwoocommerce get API for order products store name
GPLv3 forces us to make code available, but to who?
Sending mail to the Professor for PhD, after seeing his tweet
How dangerous is a very out-of-true disc brake wheel?
Why has Speaker Pelosi been so hesitant to impeach President Trump?
Confusion regarding control system of Mars Rover?
Caro-Kann c4-c5 push
SOQL injection vulnerability issue
Could Boris Johnson face criminal charges for illegally proroguing Parliament?
Is there a way to remove Smite from a weapon?
麦酒 (ばくしゅ) for "beer"
Why such a singular place for bird watching?
Citing CPLEX 12.9
How can Germany increase investments in Russia while EU economic sanctions against Russia are still in place?
Airport Security - advanced check, 4th amendment breach
Can I cast Death Ward on additional creatures without causing previous castings to end?
Is there an in-universe explanation of how Frodo's arrival in Valinor was recorded in the Red Book?
Can an untrusted VPN client monitor my network activity?
Did Joe Biden "stop a prosecution" into his son in Ukraine? And did he brag about stopping the prosecution?
Duck, duck, gone!
Would an object shot from earth fall into the sun?
Wondering why they used ultrafast diodes in a 50 or 60Hz bridge?
A word that refers to saying something in an attempt to anger or embarrass someone into doing something that they don’t want to do?
Could the Queen overturn the UK Supreme Court ruling regarding prorogation of Parliament?
Looking for circuit board material that can be dissolved
SQL Server Woocommerce API connection gives NULL when getting products, works fine with orders
SQL Client for Mac OS X that works with MS SQL ServerGet list of databases from SQL ServerHow can I get column names from a table in SQL Server?OR is not supported with CASE Statement in SQL ServerSQL Server - inner join when updatingPosting to tumblr using API v2 on iOS returning errorUsing Magento REST APIAuthintication Error in Ionic WooCommerce using AngularWhen i try to authenticate oauth1 rest api returnse Invalide_signature errorwoocommerce get API for order products store name
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.
The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.
Now here is my code :
DECLARE @contentType NVARCHAR(64);
DECLARE @ret INT;
DECLARE @responseText NVARCHAR(4000);
DECLARE @status NVARCHAR(32);
DECLARE @statusText NVARCHAR(32);
DECLARE @token INT;
DECLARE @url NVARCHAR(256);
SET @contentType = 'application/json';
set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'
EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;
EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'send', NULL;
EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;
EXEC @ret = sp_OADestroy @token;
RETURN @responseText;
When i return the status i get 200, which to my knowledge is the desirable status.
But when i return responseText i get null.
The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.
Please help, because i am losing the last few hairs on my head.
Also my boss insists on doing it by SQL Server..
sql-server api woocommerce
add a comment
|
I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.
The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.
Now here is my code :
DECLARE @contentType NVARCHAR(64);
DECLARE @ret INT;
DECLARE @responseText NVARCHAR(4000);
DECLARE @status NVARCHAR(32);
DECLARE @statusText NVARCHAR(32);
DECLARE @token INT;
DECLARE @url NVARCHAR(256);
SET @contentType = 'application/json';
set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'
EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;
EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'send', NULL;
EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;
EXEC @ret = sp_OADestroy @token;
RETURN @responseText;
When i return the status i get 200, which to my knowledge is the desirable status.
But when i return responseText i get null.
The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.
Please help, because i am losing the last few hairs on my head.
Also my boss insists on doing it by SQL Server..
sql-server api woocommerce
add a comment
|
I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.
The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.
Now here is my code :
DECLARE @contentType NVARCHAR(64);
DECLARE @ret INT;
DECLARE @responseText NVARCHAR(4000);
DECLARE @status NVARCHAR(32);
DECLARE @statusText NVARCHAR(32);
DECLARE @token INT;
DECLARE @url NVARCHAR(256);
SET @contentType = 'application/json';
set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'
EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;
EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'send', NULL;
EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;
EXEC @ret = sp_OADestroy @token;
RETURN @responseText;
When i return the status i get 200, which to my knowledge is the desirable status.
But when i return responseText i get null.
The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.
Please help, because i am losing the last few hairs on my head.
Also my boss insists on doing it by SQL Server..
sql-server api woocommerce
I am trying to set up a connection between a external SQL Server Database and the Woocommerce API.
The goal is to communicate between 2 websites, where they exchange data, the external website will send a POST request to Woocommerce to create a product, then GET the list of products to select the latest added one and then uses that product ID to create a add to cart link which will put the product into the Cart.
Now here is my code :
DECLARE @contentType NVARCHAR(64);
DECLARE @ret INT;
DECLARE @responseText NVARCHAR(4000);
DECLARE @status NVARCHAR(32);
DECLARE @statusText NVARCHAR(32);
DECLARE @token INT;
DECLARE @url NVARCHAR(256);
SET @contentType = 'application/json';
set @url = 'https://mywebsite.com/wp-json/wc/v3/products/?consumer_key=mykey&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1458225139&oauth_nonce=nVq4rX&consumer_secret=mysecret&oauth_signature=kzoVx%20VYSWlLbRpi3f8222222%3D'
EXEC @ret = sp_OACreate 'WinHttp.WinHttpRequest.5.1', @token OUT;
EXEC @ret = sp_OAMethod @token, 'open', NULL, 'GET', @url, 'false';
EXEC @ret = sp_OAMethod @token, 'setRequestHeader', NULL, 'Content-type', @contentType;
EXEC @ret = sp_OAMethod @token, 'send', NULL;
EXEC @ret = sp_OAGetProperty @token, 'status', @status OUT;
EXEC @ret = sp_OAGetProperty @token, 'statusText', @statusText OUT;
EXEC @ret = sp_OAGetProperty @token, 'responseText', @responseText OUT;
EXEC @ret = sp_OADestroy @token;
RETURN @responseText;
When i return the status i get 200, which to my knowledge is the desirable status.
But when i return responseText i get null.
The infuriating part is when i replace products with orders i get a result as expected, but when getting the products it keeps saying NULL.
Please help, because i am losing the last few hairs on my head.
Also my boss insists on doing it by SQL Server..
sql-server api woocommerce
sql-server api woocommerce
edited Mar 30 at 7:51
marc_s
605k137 gold badges1159 silver badges1292 bronze badges
605k137 gold badges1159 silver badges1292 bronze badges
asked Mar 28 at 20:53
Handler03Handler03
61 bronze badge
61 bronze badge
add a comment
|
add a comment
|
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406687%2fsql-server-woocommerce-api-connection-gives-null-when-getting-products-works-fi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406687%2fsql-server-woocommerce-api-connection-gives-null-when-getting-products-works-fi%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown