Skip to content

Commit

Permalink
Update index.md (#69)
Browse files Browse the repository at this point in the history
add REST API example in Programmatic use section
  • Loading branch information
vlouvet authored Dec 23, 2023
1 parent 33e1cef commit 05dacb7
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,29 @@ if __name__ == "__main__":
asyncio.run(async_main())
```

## Programmatic use - Search Object by Custom Field Value - REST API

```python
import asyncio

from netsuite import NetSuite, Config, TokenAuth

config = Config(
account="12345",
auth=TokenAuth(consumer_key="abc", consumer_secret="123", token_id="xyz", token_secret="456"),
)

ns = NetSuite(config)

async def async_main() -> dict:
customer_keyword = 'Test Customer'
query_params = {'q':f'Name CONTAIN "{customer_keyword}"'}
rest_api_results = await ns.rest_api.get("/record/v1/customer", params=query_params)

if __name__ == "__main__":
asyncio.run(async_main())
```

## CLI

### Configuration
Expand Down

0 comments on commit 05dacb7

Please sign in to comment.