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.

  1. Open https://email-api.socrate.io/graphql in your browser. This is the endpoint for the Email Service.

  2. 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:

    GraphQL Console for Email Service

  3. Enter the GraphQL mutation that sends an email. In this example, you send an email from the default SBS sender to your email address.

    GraphQL Console for Email Service

    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>"
           }
        }
    
  4. Click the Play button to run the mutation and send the email.