Settings API

The Settings API is an integral component of the core service. As a result, all requests should be directed to: https://api.subsbase.io/core/v2/graphql.

The core service expects 2 headers, the X-SITE-ID and Authorization so the request would be:

POST https://api.subsbase.io/core/v2/graphql
Authorization: Bearer {server token}
X-SITE-ID: {your site id}
Consuming the Settings API requires that a server token is used to authenticate the request. The server token is expected in the Authorization header.

Site Info Query

query GetSiteInfo($siteId: String!) { 
    siteInfo (siteId: $siteId) {
        isSuccess
        message
        value {
            name
            #All properties are found in the SiteInfoGQLType
        }
    } 
}

### variables
{"siteId":""}

Subscription Events Queries

Subscription Events

query GetSubscriptionEvents($siteId: String!,$filter: FilterGQLInputType,$pagination: PaginationGQLInputType,$sorting: [SortingGQLInputType]) { 
    subscriptionEvents (siteId: $siteId,filter: $filter,pagination: $pagination,sorting: $sorting) {
        isSuccess
        pagination
        data{
            id
            #All properties are found in the SubscriptionEventGQLType
        }
        message
    } 
}

### variables
{"siteId":"","filter":"","pagination":"","sorting":""}

Available Subscription Event Placeholders

query GetAvailableSubscriptionEventPlaceholders($siteId: String!) { 
    availableSubscriptionEvents (siteId: $siteId) {
        name
    #All properties are found in the SubscriptionEventPlaceholderGQLType
 
    }

### variables
{"siteId":""}

Subscription Events Mutation

Add Subscription Events

  • To update an existing subscription event, you need to use the following Mutation, it is advisable to use variables in this case since the input types are more complex than just strings:
mutation AddSubscriptionEvent(
    $siteId: String!
    $event: SubscriptionEventGQLInputType!
) {
    subscriptionEvents(siteId: $siteId) {
        add(event: $event) {
            isSuccess
            message
        }
    }
}

### variables
{
  "siteId": "test-site",
  "event": {
    "subscriptionEventId": "invoice-payment-link",
    "name": "test",
    "siteId": "test-site",
    "delay": {
      "delayType": "None"
    },
    "actions": [
      {
        "isEnabled": true,
        "name": "Send email to ",
        "email": {
          "fromDisplayName": "Subsbase",
          "subject": "test subject",
          "body": "<p>test body</p>",
          "to": "{{Customer.EmailAddress}}",
          "cC": "",
          "bCC": ""
        },
        "sms": null,
        "chatMessaging": null,
        "webhook": null
      }
    ],
    "conditions": {
      "name": "",
      "value": null,
      "operands": [],
      "operation": "AlwaysTrue",
      "valueType": null
    },
    "info": {
      "index": 24
    }
  },
  "siteSubscriptionEventId": ""
}