AnsweredAssumed Answered

Problem creating valid Slack User JSON profile

Question asked by 42180167 on Nov 2, 2016
Latest reply on Nov 4, 2016 by 42180167

I'm using Boomi's HTTP Client Connector to make an API call to fetch a User Profile from Slack. I tried using Boomi's Import feature to create the profile from a valid JSON response from that service but when i tried to use that profile within a Map I get errors.

 

Here's the API 

https://api.slack.com/methods/users.profile.get 

 

Here's what the response JSON looks like

 

{

"ok": true,

"profile": {

  "fields": {

    "Xf1D1ND000": { "value": "San Francisco", "alt": "" },

    "Xf1D1SAH6Z": { "value": "2nd Floor", "alt": ""},

    "Xf1MFW9DFS": { "value": "foo", "alt": "" }

  },

  "first_name": "John",

  "last_name": "Doe",

  "title": "Developer", "phone": "555-111-2222",

  "avatar_hash": "81a1579e5a43",

  "image_24": "https://avatars.slack-edge.com/2016-09-22/8292_79a1741_24.jpg",

  "image_original": "https://avatars.slack-edge.com/2016-09-22/8292_79a1741_original.jpg",

  "real_name": "John Doe",

  "real_name_normalized": "John Doe",

  "email": "jdoe@somecompany.com"

  }

}

 

When I use the JSON profile created by importing that JSON and try to reference the field with name "Xf1D1ND000" in a map I get the following error message.

 

Input ProfileLocation: Root/Object/profile/Object/fields/Object; DocumentLocation: /Root/Object/profile/Object/fields/Object]: Expected START_OBJECT, found START_ARRAY

 

Then I tried editing the imported JSON profile and converting the "fields" element from an Object into an Array but then I get this error message.

 

Input ProfileLocation: Root/Object/profile/Object/fields/Array; DocumentLocation: /Root/Object/profile/Object/fields/Array]: Expected START_ARRAY, found START_OBJECT

 

 

Attaching screenshots of the 2 different profiles. The imported one and the custom edited one.

 

What's wrong with my profiles?

Outcomes