Skip to content

Latest commit

 

History

History
62 lines (47 loc) · 4.56 KB

File metadata and controls

62 lines (47 loc) · 4.56 KB

Examples

All examples now read the API key from the DIDWW_API_KEY environment variable.

Prerequisites

  • Java 11+
  • Gradle wrapper (./gradlew)
  • DIDWW API key for sandbox account

Environment variables

  • DIDWW_API_KEY (required): your DIDWW API key
  • FILE_PATH (optional for UploadFileExample): file to encrypt. Generates a sample PDF if not set

Run an example

Use the runExample Gradle task with -PexampleClass:

DIDWW_API_KEY=your_api_key ./gradlew runExample -PexampleClass=com.didww.examples.BalanceExample

Available example classes

Class Description
com.didww.examples.BalanceExample Fetches and prints current account balance and credit.
com.didww.examples.CountriesExample Lists countries, demonstrates filtering, and fetches one country by ID.
com.didww.examples.RegionsExample Lists regions with filters/includes and fetches a specific region.
com.didww.examples.DidGroupsExample Fetches DID groups with included SKUs and shows group details.
com.didww.examples.DidsExample Updates DID routing/capacity by assigning trunk and capacity pool.
com.didww.examples.TrunksExample Lists trunks, creates SIP and PSTN trunks, updates and deletes them.
com.didww.examples.SharedCapacityGroupsExample Creates a shared capacity group in a capacity pool.
com.didww.examples.OrdersExample Lists orders and creates/cancels a DID order using live SKU lookup.
com.didww.examples.OrdersSkuExample Creates a DID order by SKU resolved from DID groups.
com.didww.examples.OrdersNanpaExample Orders a DID number by NPA/NXX prefix.
com.didww.examples.OrdersCapacityExample Purchases capacity by creating a capacity order item.
com.didww.examples.OrdersAvailableDidsExample Orders an available DID using included DID group SKU.
com.didww.examples.OrdersReservationDidsExample Reserves a DID and then places an order from that reservation.
com.didww.examples.OrdersAllItemTypesExample Creates a DID order with all item types: by SKU, by available DID, and by reservation. Fetches ordered DIDs.
com.didww.examples.UploadFileExample Creates (or reads) a file, encrypts it, and uploads to encrypted_files.
com.didww.examples.IdentityAddressProofsExample Creates identity and address, encrypts and uploads files, attaches proofs to both.
com.didww.examples.VoiceInTrunkGroupsExample CRUD for trunk groups with trunk relationships.
com.didww.examples.VoiceOutTrunksExample CRUD for voice out trunks (requires account config).
com.didww.examples.DidTrunkAssignmentExample Demonstrates exclusive trunk/trunk group assignment on DIDs.
com.didww.examples.DidReservationsExample Creates, lists, finds and deletes DID reservations.
com.didww.examples.ExportsExample Creates and lists CDR exports.
com.didww.examples.CapacityPoolsExample Lists capacity pools with included shared capacity groups.

Upload file example

DIDWW_API_KEY=your_api_key FILE_PATH=/absolute/path/to/file.jpeg \
  ./gradlew runExample -PexampleClass=com.didww.examples.UploadFileExample

Troubleshooting

If DIDWW_API_KEY is missing, examples fail fast with:

DIDWW_API_KEY environment variable is required