4WS Suite
Home
API Reference
  • Data mangement API
  • Documents API
Home
API Reference
  • Data mangement API
  • Documents API
Fourwayshop
  1. Miscellaneous
  • Login
    • login
      POST
  • Product
    • Brand
      • Get All Brands
      • Get A Brand
      • Insert brand
      • Update brand
    • Season
      • Get All Seasons
      • Get A Season
      • Insert season
      • Update season
    • Attribute
      • Get All Attribute Types
      • Get Attribute Type
      • Get Attribute
      • Insert attribute
      • Update attribute
    • Hierarchy
      • Insert hierarchy
      • Update hierarchy
    • Dimension groups
      • Insert dimension group
      • Update dimension group
    • Dimension
      • Insert dimension
      • Update dimension
      • Delete dimension
    • Product
      • Get products
      • Get product
      • Get product grouping
      • Get SKU's barcodes
      • Get product stock
      • Insert product
      • Update product
    • Activate dimensions on products
      • Insert active dimensions
      • Delete active dimensions
    • Barcode
      • Get SKU from barcode
      • Generate missing barcodes
      • Generate missing barcode for SKU
      • Insert barcode
      • Delete barcode
    • Prices
      • Get product prices
    • Price dimension groupings
      • Get Dimension Price Grouping
      • Get All Dimension Price Grouping
      • Insert dimension grouping
      • Update dimension grouping
      • Delete dimension grouping
    • Assortment
      • insert product assortment
      • delete product assortment
    • Image
      • Get images
      • Add image
      • Replace image
      • Delete image
    • Supplier
      • Get Item suppliers
      • Insert item supplier
      • Delete item supplier
      • Update item supplier
    • Custom category
      • Get Custom code
      • Insert Custom code
      • Update Custom code
    • Vat
      • Vat types
        • Get VAT type
        • Get VAT types
      • VATs
        • Get VATs
        • Get VATs by type
        • Get VAT
      • Vat rates
        • Get VAT rates
        • Get single VAT rates
    • Stock
      • Insert stock
      • Get stock
  • Price lists
    • Get price lists
      GET
    • Get price lists by type
      GET
    • Get price list
      GET
    • Get prices from price list
      GET
    • Get entities from price lists
      GET
    • Insert Price List
      POST
    • Insert Product Price
      POST
    • Insert Entity On Price Lists
      POST
    • Update price list
      PATCH
    • Delete all product prices
      DELETE
    • Delete single product price
      DELETE
    • Delete entity from a price lists
      DELETE
  • Supplier
    • Supplier contacts
    • Supplier addresses
    • Get Suppliers
    • Get A Specific Supplier
    • Insert supplier
    • Update supplier
  • Entities
    • Get entities
    • Get entity
    • Insert entity
    • Update entity
  • Miscellaneous
    • Get requests rate limits
      GET
  • Catalog
    • Get Catalogs details
    • Get Catalog details by Code
    • Get products by Catalog Code
  • Export
    • Get bulk CSV Export
  1. Miscellaneous

Get requests rate limits

GET
/api/v1/users/rateLimits
Last modified:2024-12-13 09:01:29

API Documentation: Rate Limit Status Retrieval#

This API allows external systems to check the rate limit status for API requests to the 4ws.trade suite. It provides real-time details about the number of requests made, remaining requests, and reset timing.

Actors#

API Client: The system or user initiating the request.
4ws.trade: The backend system that processes the request.

Preconditions#

The external system must have the necessary permissions and access to the document creation service, please refer to Authentication.
Ensure the token is valid and included in the Authorization header if required.

Main Success Scenario#

1.
API Client sends a GET request to retrieve rate limit status.
2.
4ws.suite Platform processes the request and returns the current rate limit details:
Number of requests made (requestsMade).
Remaining requests before hitting the limit (requestsBeforeLimit).
Whether additional requests are allowed (canMakeRequests).
Time when the limits will reset (resetTime).
Remaining time until reset in seconds (resetsIn).
{
  "requestsMade": 0,
  "requestsBeforeLimit": 0,
  "canMakeRequests": true,
  "resetTime": "2024-11-15T16:19:17.620Z",
  "resetsIn": 0
}

Alternate Flows#

Unauthorized Access: If the client lacks the necessary permissions or the token is missing/invalid, an error response is returned with a relevant message.
{
  "message": "Unauthorized",
  "errors": [
    {
      "msg": "Token is missing or invalid",
      "param": "Authorization",
      "location": "header"
    }
  ]
}

Sequence Diagram#

Best Practices
Please refer to Best Practices for Error Handling in External System for best practices on implementation.

Code Examples in Node.js#

Retrieve Rate Limit Status:

Request

None

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET '/api/v1/users/rateLimits'

Responses

🟢200Success
application/json
Body

Example
{
    "requestsMade": 0,
    "requestsBeforeLimit": 10,
    "canMakeRequests": true,
    "resetTime": "2024-09-02T14:45:45.861Z",
    "resetsIn": 15000
}
Modified at 2024-12-13 09:01:29
Previous
Update entity
Next
Get Catalogs details
Built with