I am using Okta for SSO. I want to list all Okta users, but the API has a max limit of 200. So I need to use pagination here.
Initial I used the URL
{{url}}/api/v1/users?limit=200
Not I got the response with the first 200 users, and a next link in the response header. The next link was like
{{url}}/api/v1/users?after=1uid&limit=200
Please have a look at the above after value. Character 1 got prepended to the last user ID. Why is that?
The after parameter value is a cursor, not a user ID. From the Okta API docs,
Pagination is based on a cursor and not on page number. The cursor is opaque to the client and specified in either the before or after query parameter.
Your value looks like a user ID, but the cursor structure could change in the future. The proper way to handle the cursor is to simply follow the next link in the response header. Your code shouldn't need to try to parse or understand the contents of the next link.
Related
This api returns me dashboard_id and dashboard_name as highlighted in attached image. My requirement is to fetch dashboard_id based on dashboard_name using this api in jmeter? Both ID and Name are unique here. Is it possible to achieve this in jmeter?
Since we do not have any api which will return me dashboard_id based on dashboard_name. So wanted to use this current api which has both ID and Name, and based on Name I want to fetch ID, and ID will be used in different request.
Using Jmeter, I am providing user credentials and dashboard_id via 'CSV Data Set Config' that is being used in request, but too many ID's are confusing, so better we want to use dashboard_name which is more readable and add current api from where we want to fetch ID, so that ID can be used in another request.
I was trying to go though Beanshell Sampler to achieve this, but still didn't find a way to achieve it. Please suggest me a way to achieve this in jmeter?
You can use JSON Extractor and the following JsonPath query:
$..[?(#.name == 'New Dashboard - 6')].dashboardId
Full configuration:
You should be able to refer the extracted id as ${dashboardId} where required.
Going forward please:
Don't post code as image
Post the code fully
Don't use Beanshell as it's performance anti-pattern
I am trying to get the Request number (RITM) that is attached in the Change Request (CR) in service now. I am able to get the Request number but not able to get for which Change Request the corresponding Request number is attached. I have used the table "sc_req_items" to get the Request number and "Change_request" table to get the Change request number.
Service now screenshot
I need the ritm number corresponding to the Change Request (CR) in the screenshot. how to get this?
There is a Out Of The Box/Baseline Related list available on the Change Request table. The query that this Related List is using is the Parent field:
parent=<sys_id/GUID for the change record>^.
If Parent (reference field) is not the link between your objects then you need to map what the link is, is it another field or an m2m table.
I have a page with table of some data (let's say posts). I have a form there which leads to the same page but with get parameters. So when I choose December in dropdown list form will lead to posts/index?month=december. Controller index method makes eloquent query using query string parameters to filter rows. After that I click edit post(or add new post) and change something through edit form. Then update or store method redirects back to index as usually. What is the best way to come back to index?month=december page? Sessions? How should I do it? Set some values from query to session in Controller index method when I come there first time and get them also in Controller method from session after editing/creating?
Try to append all request parameters in the redirect:
return redirect()->route('route_name',['month' => request()->get('month')]);
You can read more about this in this section in the docs.
Trying to append some query parameters to links created via Branch.io, but I can't figure out how to do this in the dashboard. I see from https://docs.branch.io/pages/links/integrate/ that the following is possible.
Short links can have additional data appended to them
e.g. dynamic link https://example.app.link/fzmLEhobLD?content_id=123
Append query strings https://example.app.link/fzmLEhobLD?$custom_data=123&hello=world
Is there a way to do this via Quick Links in the dashboard?
I need to create the link here to test that my Android and iOS apps can read the parameters from the link and take the user to the appropriate page, or redirect the user to the appropriate page on the website - and then bulk create similar links with the query parameters varying (either via the dashboard or the HTTP API).
Have already checked out the following - Deep link with variable query on branch.io - but this didn't seem to address the issue.
When creating a quick link under configure options, you can select the deep linking tab and click on the "+ more data" button which will allow you to add parameters to the quick link.
adding parameters to quick link
You cannot add query params in the dashboard, but you can add link data in the Link Data section. (date of the screenshot: Jan, 2021)
If you need links for different purposes, then you should create multiple links.
On the other hand, if you only need to vary one parameter, then you can reuse one link by passing a different query parameter. For example, you can create a Quick Link to add a user to a user group that looks like this - myapp.link/add, That is a Quick Link, and you can set its params in the Link Data section (e.g. set key type to value new_users
Then, on the backend (or wherever you want to "generate" links), you reuse that one link like this:
myapp.link/add?code=a1 this is inviting user L to group Y
myapp.link/add?code=b2 this is inviting user M to group Z
In your app, you can access both the code param (from query param) and the type param (defined in Link Data) in the same way, usually through a data Map.
I have user records with a unique identifier, first and last name.
I'd like to display the url as www.server.com/Profile/JoeBloggs, but pass a parameter of the unique identifier to the controller action to look up the user.
I'm able to create urls with the format www.server.com/Profile/XXX-XXXX/JoeBloggs, however don't want to show the unique id in the url - does anyone know the best way to do this?
Thanks
I'd suggest using a Form (using HtmlHelper) and an HTTP Post with the parameters instead of an Url link and an HTTP Get with query string parameters.