Call the SBS API
Now that you have a service access key to 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 using the SBS API.
-
Open https://email-api.socrate.io/graphql in your browser. This is the endpoint to the Email Service.
-
In the HTTP Headers section at the bottom of the console, enter a value for the
x-api-key
header, as shown below. This value must be the secret key you have generated previously, for example:If you are calling the service from a custom application, make sure to populate the x-api-key HTTP header programmatically. -
Enter the GraphQL mutation that actually sends an email. In this example, we send an email from the default SBS sender to your email address.
Make sure to replace the input valueYOUR_EMAIL_ADDRESS
with your actual email address.mutation sendMessage($input: SendMessageInput!) { sendMessage(input: $input) { id subject messageId } }
{ "input": { "to": { "address": "YOUR_EMAIL_ADDRESS" }, "subject": "Greetings from Socrate Business Services!", "htmlBody": "<body><p>Hello, world!</p></body>" } }
-
Click the Play button to run the mutation and send the actual email.