Quickstart: Service Invocation
This quickstart showcases how to enable the request-reply pattern using the Service Invocation API.

Prerequisites
Before you proceed, ensure you have the following prereqs installed.
- Python
- .NET
- JavaScript
- Java
Log in to Catalyst
Authenticate to Diagrid Catalyst using the following command:
diagrid login
Confirm your organization and user details are correct:
diagrid whoami
Clone Quickstart Code
Clone the quickstart code from the Diagrid Labs GitHub repository and navigate to the appropriate directory:
- Python
- .NET
- JavaScript
- Java
diagrid dev quickstart --type invoke --language python
diagrid dev quickstart --type invoke csharp
diagrid dev quickstart --type invoke --language javascript
diagrid dev quickstart --type invoke --language java
Install Dependencies and Run
The diagrid dev run command creates your Catalyst project (if needed), provisions resources (App IDs, Components), configures environment variables, and launches your application using the dapr multi-app run file.
- Python
- .NET
- JavaScript
- Java
Create and activate a Python virtual environment:
python -m venv venv
source venv/bin/activate # MacOS/Linux
# Or: venv\Scripts\activate # Windows
Windows users: Use venv\Scripts\Activate.ps1 (PowerShell) or venv\Scripts\activate.bat (Command Prompt). Use conda, pipenv, or your preferred tool if desired.
Install dependencies:
pip install -r ./client/requirements.txt && pip install -r ./server/requirements.txt
Install .NET dependencies:
dotnet restore ./client && dotnet restore ./server
Install Node dependencies:
npm install --prefix ./client && npm install --prefix ./server
Install Maven dependencies:
mvn clean install -f ./client && mvn clean install -f ./server
Run the application:
- Python
- .NET
- JavaScript
- Java
diagrid dev run -f dev-python-invocation.yaml --project dev-python-invocation
diagrid dev run -f dev-csharp-invocation.yaml --project dev-csharp-invocation
diagrid dev run -f dev-js-invocation.yaml --project dev-js-invocation
diagrid dev run -f dev-java-invocation.yaml --project dev-java-invocation
Ensure the log Connected App ID "server" to localhost:5002 appears before proceeding to the next section.
Interact with Service Invocation API
With the quickstart running, test the Service Invocation API using curl or the REST Client extension with the test.rest file.
Open a new terminal and execute the following curl command:
curl -i -X POST http://localhost:5001/order -H "Content-Type: application/json" -d '{"orderId":1}'
Upon successful execution, the server app should indicate the request was successfully received and the client app logs should output the invocation was successful.

To stop the local applications and disconnect the local app connection for the server App ID, run:
diagrid dev stop
Clean Up ResourcesOptional
If you are not going to continue to use this application, delete the app IDs:
diagrid appid delete client
diagrid appid delete server
To delete the entire Catalyst project, including the managed infrastructure resources:
diagrid project delete dev-python-invocation # or dev-csharp-invocation, dev-js-invocation, dev-java-invocation