Okta_Integration | 2023-02-22 21:17:37 UTC | #1
hello, I am new and have a question on Genesys API call. I received a 200 status call when make a API get call to get users, but there is nothing in body. Does anybody have any idea why response is blank? thanks
tim.smith | 2023-02-23 14:54:43 UTC | #2
Could you provide some details?
Okta_Integration | 2023-02-23 16:41:56 UTC | #3
hello, I issued below API get from Okta workflow using connection built via OAuth:
https://login.usw2.pure.cloud/api/v2/users?userid=467d41b6-e079-4af7-891c-21764e112202
received 200 status code with header below:
{ "strict-transport-security": "max-age=7776000", "connection": "keep-alive", "inin-correlation-id": "6ae45276-0aa4-42c2-5ca3-f8ec631d635b", "vary": "Accept-Encoding", "content-length": "0", "date": "Thu, 23 Feb 2023 15:21:03 GMT", "set-cookie": [ "ININ-Auth-Session=WP38kYcvZhigMPNIa4tEAWQBcGL0D70MR5XhoIbgCvs=; Path=/; Expires=Sat, 04 Mar 2023 15:21:03 GMT; HttpOnly; Secure; SameSite=None" ] }
but body is blank {}
I tried to issue same API call from postman using basic auth, 200 status code but blank body as well.
Eos_Rios | 2023-02-23 15:48:46 UTC | #4
Okta_Integration, post:3, topic:18540
https://login.usw2.pure.cloud/
That is the wrong region subdomain for making an API call after authorizing, it should be;
https://api.usw2.pure.cloud
tim.smith | 2023-02-23 15:58:02 UTC | #5
Thanks @Eos_Rios!
@Okta_Integration the API's URLs are documented here: https://developer.genesys.cloud/platform/api/
Okta_Integration | 2023-02-23 16:41:51 UTC | #6
when I changed to https://api.usw2.pure.cloud/, i got 404 not found error....
tim.smith | 2023-02-23 15:59:19 UTC | #7
Can you provide details on the request/response please?
Okta_Integration | 2023-02-23 16:03:50 UTC | #8
it is working now when replace login with api.. thank you all so much. One more question, is that possible to find a particular user using email, instead of userid?
Eos_Rios | 2023-02-23 16:09:31 UTC | #9
POST /api/v2/users/search
Example; https://developer.genesys.cloud/forum/t/user-id-by-its-email-address/7142/2
Okta_Integration | 2023-02-23 16:41:52 UTC | #10
got 400 bad request with below in query and URL as: https://api.usw2.pure.cloud/api/v2/users/search
{ "sortOrder": "DESC", "sortBy": "email", "pageSize": 1, "pageNumber": 1, "query": [ { "fields": [ "email" ], "value": "abalhouse@appliedsystems.com", "type": "EXACT", "operator": "AND" } ] }
tim.smith | 2023-02-23 16:31:35 UTC | #11
Sorry for sounding like a broken record, but can you provide details about the response please? It's not possible to troubleshoot errors you're getting unless you provide details about the error. The error body will often contain an error message telling you what's wrong with your request. The correlation ID from the response header can also be useful to allow me to look up some additional information if the response body isn't clear.
Okta_Integration | 2023-02-23 16:42:55 UTC | #12
sorry about that.
query used: { "sortOrder": "DESC", "sortBy": "email", "pageSize": 1, "pageNumber": 1, "query": [ { "fields": [ "email" ], "value": "okta.integration@appliedsystems.com", "type": "EXACT", "operator": "AND" } ] } error from header:
{ "error": true, "retrycount": 0, "flo": 177774, "method": "-EsD1OlJY", "execution": "29ea4ce3-e2f6-4269-a957-9ab7e10185e3", "module": "httpfunctions.post", "kind": "HTTP Request Error", "statusCode": 400, "headers": { "cache-control": "no-cache, no-store, must-revalidate", "x-cache": "Error from cloudfront", "content-length": "0", "x-amz-cf-id": "hBTjtCkDyJtQY9qGhCelN1KdvsdqyrbvFgweH6YX3EBdpCbmL0TpA==", "date": "Thu, 23 Feb 2023 16:33:01 GMT", "via": "1.1 49b94a8674d6e86a841d6523f7dbaf14.cloudfront.net (CloudFront)", "inin-correlation-id": "ad3c6ed6-2b04-448a-806c-f3f56dd8639b", "strict-transport-security": "max-age=600; includeSubDomains", "x-amz-cf-pop": "HIO50-C1", "connection": "keep-alive" }, "body": "", "message": "400 Bad Request", "code": 400, "description": "HTTP Request Error", "steps": 32, "source": { "flo": "httpfunctions:1.0.16:post", "method": "uUvUq25lDB0p", "execution": "e3c07ff7-d058-414f-bfe3-c1f620659dc4", "module": "http.call" }, "fatal": null }
tim.smith | 2023-02-23 16:41:15 UTC | #13
You didn't include any of the request details other than the body, so I can't tell what host or path you made the request to, but you've malformed something somewhere in some way. That correlation ID isn't showing up for the usw2 region within the last 24 hours and combined with the fact that the error is coming from cloudfront and not the Platform API supports the malformed host or path theory.
Okta_Integration | 2023-02-23 16:43:12 UTC | #14
the post URL is: api.usw2.pure.cloud/api/v2/users/search
Okta_Integration | 2023-02-23 16:43:43 UTC | #15
with https:// in front of api.. cannot reply with full link
tim.smith | 2023-02-23 16:47:50 UTC | #16
There's something wrong with however you're making the request. You'll have to review your application to see what it's doing exactly as the request isn't being made correctly somehow. The API endpoint works correctly using your request body in API Explorer POST /api/v2/users/search, so it must be something in your application that's not making the request as expected.
Okta_Integration | 2023-02-23 17:00:39 UTC | #17
could it be permission or scope related?
tim.smith | 2023-02-23 17:03:21 UTC | #18
Definitely not. Your request isn't actually making it to the API service.
Okta_Integration | 2023-02-23 22:19:52 UTC | #19
I received 200 status code now after make header blank. However, the search returns all users from the system, not just one specified in the query. any idea why?
Okta_Integration | 2023-02-24 16:10:28 UTC | #20
@Tim, any idea why the search result returns all user , not just the one specified in the query)?
tim.smith | 2023-02-24 16:17:50 UTC | #21
It's hard to say what's going on without seeing any details of your request and response that you've built this far.
Okta_Integration | 2023-02-24 16:22:23 UTC | #22
this is url I used on Post API call: https://api.usw2.pure.cloud/api/v2/users/search
this is query I sent for this URL: { "sortOrder": "DESC", "sortBy": "email", "pageSize": 1, "pageNumber": 1, "query": [ { "fields": [ "email" ], "value": "okta.test@appliedsystems.com", "type": "EXACT", "operator": "AND" } ] } header and body are blank
received 200 status code, body contains all 25 users, not just "okta test" below is header return from call: { "x-amz-cf-id": "YF00IjgaaTTLt7YG4dxkgyCoiErIW7E-rat9R7qyn9sd1mJZUuSwrg==", "x-cache": "Miss from cloudfront", "content-type": "application/json", "transfer-encoding": "chunked", "strict-transport-security": "max-age=600; includeSubDomains", "connection": "keep-alive", "date": "Fri, 24 Feb 2023 14:49:08 GMT", "inin-correlation-id": "12292ed7-550d-4f2c-bf43-89370347fc1c", "cache-control": "no-cache, no-store, must-revalidate", "via": "1.1 4d7fa73f804f1c93f20cfc24c4b1266e.cloudfront.net (CloudFront)", "x-amz-cf-pop": "HIO50-C1" }
tim.smith | 2023-02-24 16:32:05 UTC | #23
Okta_Integration, post:22, topic:18540
this is query I sent for this URL:
Okta_Integration, post:22, topic:18540
header and body are blank
I'm having trouble reconciling these two statements. Are you sending the JSON body you're showing or are you sending a blank body? If you are in fact sending a blank body, that would explain why you're getting unfiltered results. For privacy reasons, I'm unable to see the actual query that's being submitted on the backend, but it sounds like you're not sending the body. If you try sending the body of the query, do you get filtered results as expected?
tim.smith | 2023-02-24 16:35:09 UTC | #24
FWIW, I'm able to use your query successfully in my org only changing the value of the email address to a known user's email. This points to something wrong with how your app is sending the request, not the query or the API service.
Okta_Integration | 2023-02-24 16:53:15 UTC | #25
Tim, thank you very much for your help. I swapped what I sent on Query box and Body box below and I am getting expected result now:
Okta_Integration | 2023-02-24 18:59:51 UTC | #26
@Tim, one question. I tried to delete a user but got 400 below error:
URL used: https://api.usw2.pure.cloud/api/v2/users/7727fe18-6e88-4663-81ec-0d230657fe7e since userId is provided in URL, the query and body are both blank. I previously provided an object {"userId":"7727fe18-6e88-4663-81ec-0d230657fe7e"} to either and both query and body box but got 400 error as well
below is error response:
{ "error": true, "retrycount": 0, "flo": 177774, "method": "OZXpLvdFi", "execution": "7aa1d0b1-86f5-4f8d-ad05-4a252d237b10", "module": "httpfunctions.delete", "kind": "HTTP Request Error", "statusCode": 400, "headers": { "x-amz-cf-id": "wzWOTTEobA7RJgM8nqJsjFwsL9tUOzxVj6xvT20uQy6HEbAfN2qvWQ==", "date": "Fri, 24 Feb 2023 18:50:15 GMT", "x-cache": "Error from cloudfront", "connection": "keep-alive", "content-length": "0", "via": "1.1 a4fe306096165bb1e86e69365dc8fac2.cloudfront.net (CloudFront)", "x-amz-cf-pop": "HIO50-C1" }, "body": "", "message": "400 Bad Request", "code": 400, "description": "HTTP Request Error", "steps": 32, "source": { "flo": "httpfunctions:1.0.16:delete", "method": "wMFT-qlaWXz", "execution": "4499b671-96ac-406c-a59f-e4d281189c19", "module": "http.call" }, "_fatal": null }
could you please advise? thank you
Okta_Integration | 2023-02-24 21:07:20 UTC | #27
@Tim, i have delete working now. thank you for your time and help. @Eos_Rios, thank you for your help!
Okta_Integration | 2023-02-28 15:41:23 UTC | #29
@Tim,
I need to delete a user and his/her associated softphone under Admin/Telephony/Phone management in Genesys. I am assuming I need to delete phone first then user so I need to find phone based on user's email, correct?
When I send API post call, with URL as: https://api.usw2.pure.cloud/api/v2/telephony/providers/edges/phones/search
and with below in body:
{
"sortOrder": "DESC",
"sortBy": "email",
"pageSize": 1,
"pageNumber": 1,
"query": [
{
"fields": [
"email"
],
"value": "Okta.test1@appliedsystems.com",
"type": "EXACT",
"operator": "AND"
}
]
}
I received 405 error msg as below: { "error": true, "retrycount": 0, "flo": 231177, "method": "D8CPf5ehC", "execution": "e662e21b-431c-44e7-957b-b8f84ecab99e", "module": "httpfunctions.post", "kind": "HTTP Request Error", "statusCode": 405, "headers": { "cache-control": "no-cache, no-store, must-revalidate", "connection": "keep-alive", "strict-transport-security": "max-age=600; includeSubDomains", "content-type": "application/json", "via": "1.1 030fe0607711293dda988e571617a9f2.cloudfront.net (CloudFront)", "x-amz-cf-pop": "HIO50-C1", "x-cache": "Error from cloudfront", "date": "Mon, 27 Feb 2023 22:16:44 GMT", "content-length": "158", "inin-correlation-id": "da73012b-ce71-47c1-8aa8-bc89fe9a4c83", "x-amz-cf-id": "VxYAsSBg2IKhC9LGaBWUaeTm5ZTpm5dq62TJtFfT6QtzOxzLQmSQ==" }, "body": { "message": "HTTP 405 Method Not Allowed", "code": "method not allowed", "status": 405, "contextId": "da73012b-ce71-47c1-8aa8-bc89fe9a4c83", "details": [], "errors": [] }, "message": "405 Method Not Allowed", "code": 405, "description": "HTTP Request Error", "steps": 32, "source": { "flo": "httpfunctions:1.0.16:post", "method": "uUvUq25lDB0p", "execution": "92ed0748-3fcd-4f93-a509-eaf4d11c9f3a", "module": "http.call" }, "_fatal": null }
Could you please advice? Am I on the right path? Is there different API to delete a user's phone?
thanks a lot!!
tim.smith | 2023-02-28 16:05:02 UTC | #30
Okta_Integration, post:29, topic:18540
https://api.usw2.pure.cloud/api/v2/telephony/providers/edges/phones/search
That's not a known API endpoint.
Okta_Integration | 2023-02-28 16:09:10 UTC | #31
@Tim, how would you get a phone Id without getting all phones in response to go through all phone pages returned? thanks
tim.smith | 2023-02-28 16:12:18 UTC | #32
You can retrieve lists of stations using GET /api/v2/telephony/providers/edges/phones. There are some query parameters you can use to refine the results. If those don't give you what you want, you'll need to retrieve the list of stations and use your own custom logic to parse through the list to find the one you want.
Okta_Integration | 2023-02-28 16:25:19 UTC | #33
that sounds a long processing time if there are thousands of phones to go through.
Okta_Integration | 2023-02-28 19:59:39 UTC | #34
@Tim, I found an API call: Delete /api/v2/users/{userId}/station/associatedstation to clear associated station from the user.
However, when used this API call in my Okta workflow, I received 202 status, and the phone associated with this user is not deleted.
When I used this call from Developer Tool, it shows "0 HTTP request was blocked by CORS. Inspect the browser network tab for more information."
any advice?
thanks a lot.
tim.smith | 2023-02-28 20:09:35 UTC | #35
DELETE /api/v2/users/{userId}/station/associatedstation "Clear associated station" and DELETE /api/v2/telephony/providers/edges/phones/{phoneId} "Delete a Phone by ID" are not interchangeable. The former clears an assignment association with a user, the latter entirely deletes a phone's configuration.
tim.smith | 2023-02-28 20:13:54 UTC | #36
Okta_Integration, post:34, topic:18540
0 HTTP request was blocked by CORS. Inspect the browser network tab for more information."
The most common cause of this is that the request was mangled in some way to the point where the API didn't understand what endpoint you were trying to request so it couldn't process authorization and couldn't determine the appropriate CORS headers so it sent none. The browser prevents you from seeing anything about the response as a CORS security feature, so there's nothing that can be done to troubleshoot it directly. The typical course of action is to use your browser's dev tools to copy the request as a cURL command and run it in a shell session on your machine. The terminal doesn't care about or enforce CORS, so you can see the full response details to see what went wrong.
Okta_Integration | 2023-02-28 20:25:01 UTC | #37
i am not sure which one I need to delete: phone or station. The document I have for current manual procedure is to delete soft phone: go to admin/telephony/phone management, then type user name, then delete it, as below screen shot:
Okta_Integration | 2023-02-28 21:27:32 UTC | #38
@Tim, i am not sure which one I need to delete: phone or station. The document I have for current manual procedure is to delete soft phone: go to admin/telephony/phone management, then type user name, then delete it, as below screen shot:
system | 2023-03-31 21:27:41 UTC | #39
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: 18540