NAV Navbar

Introduction

Sample GraphQL Request:

POST https://api.edvisor.io/graphql

Sample GraphQL Request Body:

{
  "query": "query {
    student(studentId: 123) {
      firstname, 
      lastname, 
      email
    }
  }"
}

Welcome to the Edvisor.io GraphQL API! You can use this API to create, read, update, and delete commonly used objects in Edvisor.io.

This Edvisor.io API follows GraphQL (http://graphql.org/).

To access our API, please contact us at support@edvisor.io.

Integrations

An Edvisor Agency account manages information about students, staff tasks and reminders, quotes, invoices, products and services (courses, accommodations, add-ons, fees) offered by “connected” schools, products and services offered by the agency, and student registrations.

This document is provides an overview of the ways you can integrate with your edvisor agency account and the types of data you can push, pull, or synch with. Most commonly, we see Edvisor Agency integrations with 3rd party CRMs (to make quoting and registering students more seamless), B2C Websites (to provide quoting or ecommerce functionality for students online), and accounting systems.

There are three ways to integrate with your Edvisor account.

API integration

This method allows you to update data in your Edvisor account with changes in your external system by calling the Edvisor API.

Webhooks integration

This method allows you to update your external system with changes in your Edvisor account by registering a webhook and subscribing to the relevant events and implementing the necessary logic needed to handle the change event to update your existing system.

API and Webhooks integration

This method allows 2-way synchronization between your Edvisor account and your existing back-office system by combining Method 1 and Method 2.

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl "https://api.edvisor.io/graphql"
  -H "Authorization: Bearer <your_edvisor_api_key>"

Make sure to replace your_edvisor_api_key with your API key.

Edvisor.io uses API keys to allow access to the API. To access our API, please contact us at support@edvisor.io.

Edvisor.io expects for the API key to be included in all API requests to the server in a header that looks like the following:

Authorization: Bearer <your_edvisor_api_key>

Webhooks

Introduction

In addition to the available GraphQL API, Edvisor.io can register webhooks so you can synchronise the data in your agency account with an external service or system. When registering a webhook, you’re able to subscribe to specific events so that you only receive the events (synchronize the data) that you want.

For example, if you’d like keep the student information in your external CRM up-to-date with changes made to students in your Edvisor.io account, you can register a webhook that subscribes to the “student:update” event. When a student is updated on Edvisor.io, we will then send the updated information to a pre-set URL.

Sample Webhook:

Webhook endpoint: https://api.your-agency.com/webhook/edvisor

Events subscribed: student:create, student:update

What happens: When a student is updated or created, we will send a POST https://api.your-agency.com/webhook/edvisor request with a body containing the changes that represent the event.

Responding to a webhook

To acknowledge receipt of a webhook, your endpoint should return a 2xx HTTP status code. Any other information returned in the request headers or request body is ignored. All response codes outside this range, including 3xx codes, will indicate to Edvisor.io that you did not receive the webhook. This does mean that a URL redirection or a “Not Modified” response will be treated as a failure.

If a webhook is not successfully received for any reason, Edvisor.io will continue trying to send the webhook once every 15 minutes for up to 3 days.

Available events

Student

School

Offering

Quote

Promotion

Student enrollment

Event Object

The event object that is sent along with the webhook request will be structured like the following:

Sample Event object:

{
  "created": "2017-03-31T19:12:43.687Z",
  "user": {
    "userId": 1,
    "firstname": "John",
    "lastname": "Garcia",
    "email": "john.garcia@education-agency.com"
  },
  "type": "student:update",
  "data": {
    "after": {
      "studentId": 1,
      "email": "frank@email.com"
    },
    "before": {
      "studentId": 1,
      "email": ""
    }
  }
}
Attribute Description
created Timestamp of when this event occured
user Information regarding the creator of this event
user.userId
user.firstname
user.lastname
user.email
type Event name (ie. student:create)
data
data.after The object affected AFTER the event has taken place
data.before the object BEFORE the event took place

API

You can view the full API documentation for our GraphQL API here.

Please note that we are currently using GraphQL which is quite different from typical RESTful API’s. To learn more about how to interact with a GraphQL API, please checkout http://graphql.org/.

To access our API, please contact us at support@edvisor.io.

Errors

Edvisor.io will respond with a 200 success code even if there are operational errors. This follows the GraphQL specification. All errors will be described in an errors array in the response.

#Sample error response

{
  "data": {
    "agencyCompany": null
  },
  "errors": [
    {
      "message": "Unauthenticated",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "agencyCompany"
      ]
    }
  ]
}