10

I am noticing a difference in the "User Type" field returned from the REST UserInfo Endpoint (link) vs the SOAP getUserInfo() method (link) as follows:

SOAP

  • Standard
  • PowerPartner

REST

  • STANDARD
  • POWER_PARTNER

Is this documented somewhere? I can build out a mapping if I have to, but was looking for an authoritative answer.

6

What would you accept as an authoritative answer here? Someone internal to Salesforce could look at the underlying implementation and see the why of it. The best I can do is look at the available documentation and WSDLs.

My assumption is that the internal values that Salesforce have for the User Type were manipulated when exposed via the SOAP based api to align with other areas in the API.

For example, the User.UserType field is a picklist, with the values of:

  • Standard
  • PowerPartner
  • CSPLitePortal
  • CustomerSuccess
  • PowerCustomerSuccess
  • CsnOnly

This makes it consistent with the getUserInfoResult.userType field returned by getUserInfo().

Dropping the underscore and switching to pascel casing may have occured to improve WSDL compatibility with the xsd:enumeration values.

The same consideration hasn't been applied to the younger REST API UserInfo Endpoint Response. I suspect there you are seeing values that are closer to the internal Salesforce representation of the data. It would be interesting to check how these compare to the User.UserType exposed in the REST API.

For what it's worth, the query /services/data/v34.0/query/?q=Select+UserType+from+User against the REST API

Returned:

  • "UserType" : "Standard"
  • "UserType" : "CsnOnly"

I didn't have a Power Partner user setup to test against.

A call to /services/data/v34.0/sobjects/User/describe gives the UserType picklistValues as:

"picklistValues" : [ {
      "active" : true,
      "defaultValue" : false,
      "label" : "Standard",
      "validFor" : null,
      "value" : "Standard"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "Partner",
      "validFor" : null,
      "value" : "PowerPartner"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "Customer Portal Manager",
      "validFor" : null,
      "value" : "PowerCustomerSuccess"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "Customer Portal User",
      "validFor" : null,
      "value" : "CustomerSuccess"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "Guest",
      "validFor" : null,
      "value" : "Guest"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "High Volume Portal",
      "validFor" : null,
      "value" : "CspLitePortal"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "CSN Only",
      "validFor" : null,
      "value" : "CsnOnly"
    }, {
      "active" : true,
      "defaultValue" : false,
      "label" : "Self Service",
      "validFor" : null,
      "value" : "SelfService"
    } ],

Based on that, I'd say you've found a bug with the REST getUserInfo() call.

  • Ya, I think it might be a bug as well. I pretty much went down the same path of research, but you have done a much better job documenting it than me :) I just have a case/switch statement in my code to normalize it back to the picklist values returned from the describe method. – dana Jul 28 '15 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.