Setting up lookup keys

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

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

      1. Setup Lookup Keys using admin console.

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

800px

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._

      1. API Endpoints
        1. Creating a new Lookup Key
POST http://{url}/api/v2/system/lookup

Request Body:

{
    "resource":[
        {
            "name":"",
            "value":"",
            "private":bool
        }
    ]
}
        1. Editing a Lookup Key
PATCH http://{url}/api/v2/system/lookup/{lookup_key_id}

Request Body:

{
    "resource":[
        {
            "name":"",
            "value":"",
            "private":bool
        }
    ]
}
      1. 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
      1. 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