.ysl files in your workspace, making them easy to version and share.
Creating a REST request
REST request structure
Each request is stored as a.ysl file in the yasumu/rest/ directory:
Programmatic REST operations
Creating a request
Use theRestModule.create() method to create requests programmatically:
Listing requests
Getting a specific request
Updating a request
Deleting a request
HTTP methods
Yasumu supports all standard HTTP methods:GET- Retrieve resourcesPOST- Create resourcesPUT- Update/replace resourcesPATCH- Partially update resourcesDELETE- Remove resourcesHEAD- Get headers onlyOPTIONS- Get supported methods
Request configuration
URL parameters
Use path parameters with colon syntax::userId in the URL will be replaced with 123 at runtime, resulting in:
Query parameters
Add search parameters to your requests:https://api.example.com/users?page=1&limit=50&sort=name
Request headers
Request body
For requests that support a body (POST, PUT, PATCH):Pre-request and post-response scripts
Yasumu allows you to run TypeScript code before sending requests or after receiving responses:Execute scripts programmatically
Request history
Yasumu tracks request execution history:Using environment variables
Reference environment variables in your requests using{{VARIABLE_NAME}}:
Best practices
- Descriptive names: Use clear, descriptive names for requests
- Organize with groups: Use folders to organize related requests
- Environment variables: Store URLs and tokens as variables
- Disable unused parameters: Toggle
enabled: falseinstead of deleting - Use scripts: Automate repetitive tasks with pre/post scripts
- Track history: Review past executions to debug issues
Next steps
Environment variables
Manage dynamic values in requests
Testing emails
Test email workflows with SMTP