Testing

You can test the implementation of your app API using Qmiix’s fully-automated endpoint testing tool. The tool will make requests against your API using sample data you provide and perform validation on the responses.

Your app must pass all of the endpoint testing tool’s tests before it can be reviewed for publication.

The test/setup endpoint

Before starting an automated test, the endpoint testing tool will send a POST request to partner API’s test/setup endpoint. This serves as a signal to partner app's API that a test is about to begin.

When the test/setup endpoint is called, it should perform the following:

  • If needed, prepare mock users and other test fixtures, so that your API’s endpoints can respond with meaningful data.

  • Provide sample input that can be used in subsequent calls to your service API. This includes:

  • A valid OAuth access token, corresponding to a real user account.

  • Sample input parameters for each of your API’s endpoints.

For security, the endpoint testing tool will send your App Key in the request to test/setup in the Qmiix-App-Key header. Before performing any of the above operations, partner app should verify that the value of the header matches the value for your App Key, as displayed in the Qmiix Partner UI.

Request

HTTP


Method

POST

URL

{{api_url_prefix}}/qmiix/v1/test/setup

HEADERS


Qmiix-App-Key: vFRqPGZBmZjB8JPp3mBFqOdt

Accept: application/json

Accept-Charset: utf-8

Accept-Encoding: gzip, deflate

Example


POST /qmiix/v1/test/setup HTTP/1.1

Host: api.example-service.com

Qmiix-App-Key: vFRqPGZBmZjB8JPp3mBFqOdt

Accept: application/json

Accept-Charset: utf-8

Accept-Encoding: gzip, deflate

Response


HTTP/1.1 200 OK

Content-Type: application/json; charset=utf-8

{

  "data": {

    "access_token": "taSvYgeXfM1HjVISJbUXVBIw1YUkKABm",

    "samples": {

      "triggers": {

        "new_file_in_a_folder": {

          "trigger_essentials": {

            "nas": "myNAS",

            "folder_path": "public"

          }

        },

        "any_new_song_in_album": {

          "trigger_essentials": {

          "nas": "myNAS",

          "singer": "ed sheeran",

          "album": "Hits Collection"

        }

      }

    },

    "triggerEssentialValidations": {

      "new_file_in_a_folder": {

      "value": "new.txt",

      "data": [

        {

          "dependency_sequence": 0,

          "key_name": "nas",

          "value": "myNAS"

        },

        {

          "dependency_sequence": 1,

           "key_name": "folder_path",

           "value": "public"

        }

      ]

    }

  },

  "triggerEssentialOptions": {

    "any_new_song_in_album": {

      "data": [

        {

          "dependency_sequence": 0,

          "key_name": "nas",

          "value": "myNAS"

        },

        {

          "dependency_sequence": 1,

          "key_name": "singer",

          "value": "ed sheeran"

        }

      ]

    }

  },

  "actions": {

    "append_to_file": {

      "action_essentials": {

      "album": "Sports",

      "url": "http://example.com/foo/jpg",

      "description": "AT&T Park"

      }

    }

  },

  "actionEssentialValidations": {

    "download_new_photo_in_album": {

      "value": "me.jpg",

      "data": [

        {

          "dependency_sequence": 0,

          "key_name": "nas",

          "value": "myNAS"

        },

        {

          "dependency_sequence": 1,

          "key_name": "album",

          "value": "Italy"

        }

      ]

    }

  },

  "actionEssentialOptions": {

    "download_new_photo_in_album": {

      "data": [

        {

          "dependency_sequence": 0,

          "key_name": "nas",

          "value": "myNAS"

        },

        {

          "dependency_sequence": 1,

          "key_name": "album",

          "value": "myAlbum"

        }

      ]

    }

  }

}  

Extra Data

Qmiix may decide at any point in the future to include additional data sent to your API in order to provide extra information, optional features, or to aid in debugging. We do not consider this a breaking change, and ask that you do not either. To you put it simply, you should always expect that Qmiix may add additional JSON data at any time and your API should function correctly if it does.

To ensure that your API adheres to this requirement, you’ll notice an endpoint test labelled “with extra data”. This test API request includes an additional randomly generated key/value pair in the JSON and expects that your API should ignore it and process the request normally.