Genesys Cloud - Developer Community!

 View Only

Sign Up

Expand all | Collapse all

Status 400 for mentioned API end point

  • 1.  Status 400 for mentioned API end point

    Posted 05-16-2025 10:57

    We are using POST - /api/v2/workforcemanagement/businessunits/:businessUnitId/weeks/:weekId/schedules/:scheduleId/agentschedules/query and providing valid path variables key businessUnitId, weekId (yyyy-MM-dd) and scheduleId. In postman under Body RAW we put valid managementUnitId but still I am getting Status 400 while calling the API.

    Not sure what am I missing ?


    #PlatformAPI

    ------------------------------
    Jignesh Chaudhari
    ------------------------------


  • 2.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 08:38

    Can you post the body of the response?



    ------------------------------
    --Jason
    ------------------------------



  • 3.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 10:08

    Sure in params you can see below

    and under Body (raw) I put this

    IDs are valid and Genesys Development Center UI gave me result. 

    This is what I see in postman for above API payload request.

    Thanks for looking into it.



    ------------------------------
    Jignesh Chaudhari
    ------------------------------



  • 4.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 14:01

    Looks like you're using Postman. Can you show the "Raw" response tab? 



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 5.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 14:07

    Yes I am using Postman for data analysis.

    There is no result in any format. Postman Raw response Tab for same parameters



    ------------------------------
    Jignesh Chaudhari
    ------------------------------



  • 6.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 14:18

    FYI I tried Genesys Cloud Developer Center setup too for same parameters.

    It can gave me this result



    ------------------------------
    Jignesh Chaudhari
    ------------------------------



  • 7.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 15:01

    So there's no content at all in the response body? Not even a contextId or a correlationId? you should be getting more back from the API than just the http status even in an error state. Perhaps you could post a cURL from postman?



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 8.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 15:44

    Yes exactly here cURL. I hide Auth bearer token for security reason.

    Here (I used Postman API collection from Genesys Site only)

    curl --location 'https://api.mypurecloud.com/api/v2/workforcemanagement/businessunits/020193c2-e20d-4c08-92cc-24a886c9ecae/weeks/2025-03-10/schedules/8de636b7-3537-4a71-b054-6c0fa507ccb7/agentschedules/query' \
    --header 'Content-Type: application/json' \
    --header 'Content-Type: application/json' \
    --header 'Accept: application/json' \
    --header 'Authorization: bearer ****************************************************-Rg' \
    --data '{
      "managementUnitId": "0e7417b0-b355-4e41-b9a1-a3ec9526b5f0"
    }'



    ------------------------------
    Jignesh Chaudhari
    ------------------------------



  • 9.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 15:59

    That all looks right. I think I'm going to have to refer you to care as we'd need some more information (correlationid specifically) to investigate what's going wrong (and we can't actually debug any further here in the forum).



    ------------------------------
    Brian Trezise
    Genesys - Employees - Lead Software Engineer
    ------------------------------



  • 10.  RE: Status 400 for mentioned API end point

    Posted 05-19-2025 17:11

    No issues thanks for trying we are still in QA that is why I did not reach our to Care first but let me try with them thanks



    ------------------------------
    Jignesh Chaudhari
    ------------------------------



  • 11.  RE: Status 400 for mentioned API end point

    Posted 05-20-2025 07:42

    Hey Community members great news. I figured out what was wrong. Thanks for all support

    In my Header Key I have Content-Type Called twice with this new cURL it let me send request and gave me response.



    ------------------------------
    Jignesh Chaudhari
    ------------------------------