Call the SBS API
Now that you have a service access key for the SBS API, you can use it in your program code or business application.
As an example, let’s call the Email Service and send an email.
desktop app as API client. As an alternative, you can use any other API client (such as cURL
or Fiddler
) and achieve the same result.
-
Download the Postman desktop app from https://www.postman.com/downloads/.
-
Run the app and sign up for an account (or sign in to your existing account).
-
Select an existing workspace or create a new one.

-
Click New, and then select GraphQL.

-
Enter the URL of the SBS endpoint that you want to call (in this example,
https://email-api.socrate.io/graphql).
-
On the Authorization tab, select API Key. Set the key name to
x-api-keyand the key value to the secret key generated previously.
For security purposes, you will likely want to click Set as Variable and store the key value as a variable. In the screen capture below, the variable name is
{{SBS_ACCESS_KEY}}.
-
On the Query tab, click Use GraphQL Introspection. As a result, the GraphQL schema is loaded from the API.

-
Enter the GraphQL mutation and variables directly in the upper-right and lower-right text boxes, respectively. The code is included below, for convenience.

mutation sendMessage ($input:SendMessageInput!) { sendMessage( input: $input ) { id messageId from { name address } to { name address } subject textBody } }{ "input": { "to": [{ "address": "{{YOUR_EMAIL_ADDRESS}}" }], "subject": "Hello from Socrate Business Services!", "textBody": "This is a test email" } } -
Replace
{{YOUR_EMAIL_ADDRESS}}as required, and click Query to send the email. If the email was sent successfully, you are presented with a result similar to the one below: