Managing user lookups

From DreamFactory
Jump to: navigation, search
DreamFactoryTutorialsManaging user lookups

You can use the API to manage user lookups.

To add a user lookup you update the user record and include the relationship 'user_lookup_by_user_id'.

PATCH /api/v2/system/user?related=user_lookup_by_user_id  
{
  "resource": [
    {
      "id": 2,
      "user_lookup_by_user_id": [
        {
          "name": "favorite_food",
          "value": "pizza",
          "private": false,
          "description": null
        }
      ]
    }
  ]
}

To retrieve user lookups you include the relationship 'user_lookup_by_user_id'.

GET /api/v2/system/user?related=user_lookup_by_user_id  
{
  "resource": [
    {
      "id": 2,
      "name": "Test User",
      "username": null,
      "first_name": "Test",
      "last_name": "User",
      "last_login_date": null,
      "email": "[email protected]",
      "is_active": true,
      "phone": "[email protected]",
      "security_question": null,
      "confirm_code": null,
      "default_app_id": null,
      "oauth_provider": null,
      "created_date": "2016-09-16 16:39:54",
      "last_modified_date": "2016-09-16 16:39:54",
      "created_by_id": 1,
      "last_modified_by_id": 1,
      "user_lookup_by_user_id": [
        {
          "id": 1,
          "user_id": 2,
          "name": "favorite_food",
          "value": "pizza",
          "private": false,
          "description": null,
          "created_date": "2016-09-16 16:39:54",
          "last_modified_date": "2016-09-16 16:39:54",
          "created_by_id": null,
          "last_modified_by_id": null
        }
      ]
    }
  ]
}