Using API to POST a user and set their Manager

New Here ,
Jun 09, 2017

Copy link to clipboard

Copied

We cannot get the POST User to assign a Manager when adding a User. Is there some permissions that need to be set to assign a manager during a POST user. Or are we missing the correct syntax in the “relationship” part of the body? What should be set for the “type” in the “relationship” section of the POST? If we take the “relationship” section out it works and the user’s Manager gets assigned to our root Manager account. But we want to assign specific Manager's during the POST.

Also, can a user have more than one Manager ?

Below is our body for the POST and the Response that comes back:

Body:

{

  "data": {

    "type": "user",

    "attributes": {

      "email": "ssmith@acme.com",

      "name": "Sydney Smith",

      "profile": "employee",

      "roles": [

        "Learner", "Manager", "Admin"

      ],

      "userType": "INTERNAL",

      "state": "ACTIVE"

    },

    "relationships": {

      "manager": {

        "type": "user",

        "id": "1313314"             // This is a valid user Id in the system

      }

    }

  }

}

Response Body:

{

  "status": "BAD_REQUEST",

  "title": "Missing Param",

  "source": {

    "info": "Couldn't find the type for a relationship"

  }

}

Views

255

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
Feb 07, 2019

Copy link to clipboard

Copied

if it actually  you need  to add : (data field) and then probable the Id of user in the top

"relationships": {

      "manager": {

        "data":{

        "id": "5657657653",

        "type": "user"

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more