Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Saved Search Example #19

Open
nsjs opened this issue Nov 19, 2014 · 1 comment
Open

Saved Search Example #19

nsjs opened this issue Nov 19, 2014 · 1 comment

Comments

@nsjs
Copy link

nsjs commented Nov 19, 2014

Can anyone provide an example request for the Saved Search request? I have not been able to get it working. Based on the request structure provided in the readme, I am trying the following curl request to receive the results of the saved search of 321 (ie, the search is available at https://system.netsuite.com/app/common/search/searchresults.nl?searchid=321):

curl -H "Authorization: NLAuth nlauth_account=12345678,[email protected],nlauth_signature=s3cr3t,nlauth_role=123" -H "Content-Type: application/json" -d '[{"search_id": "321", "record_type": "search", "lower_bound": "0", "batch_size": "20"}]' https://rest.netsuite.com/app/site/hosting/restlet.nl\?script\=101\&deploy\=1 | python -m json.tool

This results in the following error:

{
    "params": {},
    "result": {
        "message": "The record type [UNDEFINED] is invalid.",
        "trace": [
            "restletwrapper(null$lib:4)"
        ]
    },
    "success": true
}

I built this request based on the readme and my successful curl requests for the Load end-point. For instance, this results in a successful request to load a vendor with ID 47434:

curl -H "Authorization: NLAuth nlauth_account=12345678,[email protected],nlauth_signature=s3cr3t,nlauth_role=123" -H "Content-Type: application/json" -d '[{"internalid": "47434", "record_type": "vendor"}]' https://rest.netsuite.com/app/site/hosting/restlet.nl\?script\=100\&deploy\=1 | python -m json.tool

What should the proper JSON request look like for the saved search?

@angelf
Copy link

angelf commented Jan 27, 2015

That's what's working for me

curl -D - --data "{\"search_id\":49, \"record_type\": \"Transaction\", \"batch_size\": 100, \"lower_bound\": 0}" -H "Content-Type: application/json" -H "Authorization: NLAuth nlauth_account=xxxx,nlauth_email=xxxxx,nlauth_signature=xxxxxx,nlauth_role=xxxxx" "https://rest.sandbox.netsuite.com/app/site/hosting/restlet.nl?script=304&deploy=1"

Are you trying to retrieve a list of 'searches' or of other objects?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants