Setting up lookup keys

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsSetting up lookup keys

You can create as many lookup keys as you need using the admin console as well as the API.

Set up Lookup Keys using admin console

Log in to the admin console and click on the 'Config' tab. From the left menu, click on the 'Global Lookup Keys' button. You can create a new Lookup key or edit an existing one using this 'Global Lookup Keys Overview' form.

Tutorial setting lookup keys.png

To edit an existing Lookup Key:

  • Select the Lookup Key from the '-- Select Lookup Key --' drop down.
  • Edit the name and value field.
  • Update it.

To add a new Lookup Key:

  • Click on the [+] (plus) button.
  • Add your name and value for the key.
  • Save it.

Note: Checking the 'Private' checkbox will hide the value of the key.

API Endpoints

Creating a new Lookup Key

POST http://{url}/api/v2/system/lookup

Request Body:

{
    "resource":[
        {
            "name":"",
            "value":"",
            "private":bool
        }
    ]
}

Editing a Lookup Key

PATCH http://{url}/api/v2/system/lookup/{lookup_key_id}

Request Body:

{
    "resource":[
        {
            "name":"",
            "value":"",
            "private":bool
        }
    ]
}

Example - Creating a new Lookup Key

  • Request Body:
{
    "resource":[
        {
            "name":"host",
            "value":"localhost",
            "private":false
        }
    ]
}
  • Request URL:
POST http://foo.com/api/v2/system/lookup

Example - Editing a Lookup Key

  • ID of the Lookup Key to edit: 1
  • Request Body:
{
    "resource":[
        {
            "name":"host",
            "value":"localhost",
            "private":true
        }
    ]
}
  • Request URL:
PATCH http://foo.com/api/v2/system/lookup/1