Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Using Postman, import the API collection above

    Image RemovedImage Added
  2. Once imported, navigate to the ‘Create New Authentication’ API call under the ‘Authorization setup' folder

  3. Identify the ‘Authorization’ tab once selecting the api from the folder list

  4. Choose ‘Basic Auth’ from the drop down

  5. Enter the credentials of the Sharpen account corresponding with the account you’re interfacing with

  6. Click ‘Send’

  7. Response should look like

...

  1. Identify the ‘SharpenDB2 Select’ request under the ‘SharpenDB2’ folder in the Postman collection

  2. Under the ‘Authorization’ tab, set the ‘Type’ to “No Auth”

  3. Under the ‘Headers’ tab add the following keys (x-api-key and x-api-secret)

  4. Enter the values in correspondence with what was retrieved in the ‘Gathering apiKey and apiSecret’ section of this document

  5. Under the ‘Body’ tab enter your query in JSON format

  6. Click ‘Send’

  7. The request and response should look something like this…

Anchor
Examples
Examples
QUERY Examples

The examples below show how to convert common mySQL queries into json bodies for the api requests above.

Expand
titleJSON Examples

SELECT

Code Block
languagesql
SELECT `file` FROM SoundFiles WHERE `inboundNumber` = '5551234567'
{
  "type": "select",
  "fields": [ "file" ],
  "condition": [
    {
      "inboundNumber": {"$eq": "5551234567"}
    }
  ]
}

SELECT with JOIN

Code Block
languagesql
SELECT * FROM PhoneNumbers JOIN Clients ON PhoneNumbers.number = Clients.number;
{
  "type": "select",
  "join": {
    "Clients": {
      "on": {"PhoneNumbers.number": "Clients.number"}
    }
  }
}

INSERT

Code Block
languagesql
INSERT INTO Clients (name, age, number) VALUES ("John", 24, "5551234567");
{
  "type": "insert",
  "values": [
    {
      "name": "John",
      "age": 24,
      "number": "5551234567"
    }
  ]
}

UPDATE

Code Block
languagesql
UPDATE Clients SET age = 25, number = "5552345678" WHERE name = 'John';
{
  "type": "update",
  "condition": {
    "name": "John"
  },
  "modifier": {
    "age": "25",
    "number": "5552345678"
  }
}

DELETE

Code Block
languagesql
DELETE FROM Clients WHERE number = "5551234567";
{
  "type": "remove",
  "condition": {
    "number": "5551234567"
  }
}

...