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 using the SBS API.
-
Open https://email-api.socrate.io/graphql in your browser. This is the endpoint for 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 generated earlier, for example:If you are calling the service from a custom application, make sure to set the x-api-key HTTP header programmatically. -
Enter the GraphQL mutation that sends an email. In this example, you send an email from the default SBS sender to your email address.
Be 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 email.