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.

  1. Open https://email-api.socrate.io/graphql in your browser. This is the endpoint to 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 have generated previously, for example:

    GraphQL Console for Email Service

  3. 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.

    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 actual email.