How do i list all purchase orders? <https://system...
# suitetalkapi
m
How do i list all purchase orders? https://system.netsuite.com/help/helpcenter/en_US/APIs/REST_API_Browser/record/v1/2023.1/index.html#tag-purchaseOrder i am doing GET
{{REST_SERVICES}}/record/v1/purchaseOrder?q=test
The error coming is
Copy code
{
  "type": "<https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1>",
  "title": "Bad Request",
  "status": 400,
  "o:errorDetails": [
    {
      "detail": "Invalid search query. Provide a valid search query.",
      "o:errorQueryParam": "q",
      "o:errorCode": "INVALID_PARAMETER"
    }
  ]
}
Can anyone help me out in this?
c
“test” is not a query?
m
i tried using the suiteql
SELECT * from purchaseOrder
but it gave error
b
the q query parameter is used with Record Filtering
it is not a suiteql query, and the string
test
is not a valid query
m
@battk
{{REST_SERVICES}}/record/v1/purchaseOrder?q=email EMPTY_NOT
on running this i am still getting this error
Copy code
{
  "type": "<https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1>",
  "title": "Bad Request",
  "status": 400,
  "o:errorDetails": [
    {
      "detail": "Unknown field name 'email' in the search query. The field does not exist on this record type.",
      "o:errorQueryParam": "q",
      "o:errorCode": "NONEXISTENT_FIELD"
    }
  ]
}
i checked in netsuite every purchase order has field email but it is not showing here
m
Try this :
Copy code
/services/rest/query/v1/suiteql
Copy code
"q": "SELECT email FROM transaction WHERE type = 'PurchOrd' GROUP BY email "
m
@Muhammad Hafiz
Copy code
{
  "type": "<https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1>",
  "title": "Bad Request",
  "status": 400,
  "o:errorDetails": [
    {
      "detail": "Invalid search query. Detailed unprocessed description follows. Search error occurred: Record 'transaction' was not found.",
      "o:errorQueryParam": "q",
      "o:errorCode": "INVALID_PARAMETER"
    }
  ]
}
b
your role is missing the permission to find transactions
m
I have given full permission for this. Still getting the same error
b
which permissions does the role have
m
Full permission for purchase order
Admin role
b
whats the internal id of the role
m
@battk
b
that is not administrator
nor have you assigned the find transaction permission
its a literal permission
m
@battk thanks added find transaction and it worked