Legacy Dev Forum Posts

 View Only

Sign Up

Find UserID by EmailAddress

  • 1.  Find UserID by EmailAddress

    Posted 06-05-2025 18:06

    Rajnish_Roy | 2021-04-14 19:55:16 UTC | #1

    Hello All,

    I am trying to pull UserID based on emailAddress search. I am using below query as a post method:- But it retrun me error=

    Not sure what wrong i am doing here.

    Response=

    { "message": "Value [] is not valid for field type [SortOrder]. Allowable values are: ASC, DESC, SCORE", "code": "invalid.value", "status": 400 }

    Post query is as below

    { "sortOrder": "ASC", "sortBy": "email", "pageSize": 1, "pageNumber": 1, "sort": [ { "sortOrder": "", "sortBy": "" } ], "expand": [], "query": [ { "endValue": "", "values": [], "startValue": "", "fields": ["email"], "value": "XYZ@ABC.com", "operator": "", "group": [ { "endValue": "", "values": [], "startValue": "", "fields": [], "value": "", "operator": "", "group": [ { "endValue": "", "values": [], "startValue": "", "fields": [], "value": "", "operator": "", "group": [ {} ], "dateFormat": "", "type": "" } ], "dateFormat": "", "type": "" } ], "dateFormat": "", "type": "" } ], "integrationPresenceSource": "", "enforcePermissions": true }


    Rajnish_Roy | 2021-04-14 20:54:33 UTC | #2

    I have update my json body as below. WIth this Json body, Post query returns details of user while when i send the same query using Postman. Post reply with below error message:-

    Not sure what is the causing Postman to reply wrongly, while developer.mypurecloud does reply to same json body correctly.

    post:- https://api.mypurecloud.ie/api/v2/users/search

    Response from json using postman {

    "message": "HTTP 415 Unsupported Media Type",

    "code": "unsupported media type",

    "status": 415,

    "contextId": "1c907b81-6a67-488d-81a5-c5d92744f505",

    "details": [],

    "errors": []

    }

    JSON BOdy=

    { "sortOrder": "DESC", "sortBy": "email", "pageSize": 1, "pageNumber": 1, "query": [ { "fields": ["email"], "value": "XYZ@abc.com", "type": "EXACT", "operator":"AND" } ] }


    Jerome.Saint-Marc | 2021-04-15 10:09:52 UTC | #3

    Hello,

    You are probably missing an HTTP header on Postman side. You need to add Content-Type header with value application/json as you have probably selected "Raw" radio button in Postman Body's tab.

    Regards,


    system | 2021-05-16 10:09:55 UTC | #4

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 10638