suiteql Rest API InvalidSignature error
# ask-stanley-ai
m
suiteql Rest API InvalidSignature error
c
AI generated answer (using internal Slack threads):
Based on the conversations, the
INVALID_LOGIN_ATTEMPT
error when calling a NetSuite Restlet from a C# application or using PHP and OAuth 1.0 to connect to the REST API, is often due to an incorrect signature. The signature base string should be constructed correctly as per the [RFC 5849 Section 3.4.1](https://www.rfc-editor.org/rfc/rfc5849#section-3.4.1) documentation. This includes the request parameters as part of the query. Here is an example of how to construct the base string in PHP:
Copy code
php
$baseString = "POST&" . rawurlencode($url) . "&" .
    rawurlencode(
            "oauth_consumer_key=" . rawurlencode(CONSUMER_KEY) .
            "&oauth_nonce=" . rawurlencode($nonce) .
            "&oauth_signature_method=" . rawurlencode('HMAC-SHA256') .
            "&oauth_timestamp=" . rawurlencode($timestamp) .
            "&oauth_token=" . rawurlencode(TOKEN_ID) .
            "&oauth_version=1.0");
If you are getting an
Internal Server Error
when running advanced SuiteQL using the REST services API, you can try wrapping your SuiteQL query like this:
SELECT * FROM ( SELECT TOP 1 id FROM transaction UNION SELECT TOP 1 id FROM transaction )
. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81060791
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.810180664
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.809204102
Please provide your feedback on this answer.