airtable-api-0.3.2.3: Requesting and introspecting Tables within an Airtable project.

Safe HaskellNone
LanguageHaskell2010

Airtable.Query

Contents

Synopsis

Documentation

Configuration for Airtable requests.

data AirtableOptions Source #

Options

Constructors

AirtableOptions 

Fields

  • apiKey :: String

    the API key for your project

  • appId :: String

    the app ID for your project (http://api.airtable.com/v0/app...)

  • apiVersion :: Int

    api version (http://api.airtable.com/v../...)

defaultAirtableOptions :: AirtableOptions Source #

Airtable options defaulting to API version 0. Please change the apiKey and appId fields.

tableNameToUrl :: AirtableOptions -> TableName -> String Source #

Produce a request URL to a table.

API

getRecords :: (HasCallStack, FromJSON a) => AirtableOptions -> TableName -> IO (Table a) Source #

Retrieve the records for a table from airtable.com given its name. Handles pagination correctly.

getRecordsFromUrl :: (HasCallStack, FromJSON a) => Options -> String -> IO (Table a) Source #

Retrieve the records for a table given a URL and network (Wreq) options.

createRecord :: (HasCallStack, ToJSON a, FromJSON a) => AirtableOptions -> TableName -> a -> IO (Record a) Source #

Upload a record to a given table. Returns the newly created RecordID.

updateRecord :: ToJSON a => AirtableOptions -> TableName -> RecordID -> a -> IO () Source #

Update a record on a given table, using the supplied fields (a).

deleteRecord :: AirtableOptions -> TableName -> RecordID -> IO () Source #

Delete a record on a table.

Low-level helpers