Bulk assignment of multiple users to an app in Okta through Postman API - rest

I am trying to add some users to an application in Okta simultaneously through Postman API i.e. bulk assignment of multiple users to an app. Assigning them at a time will save my manual labour as well as time.
For example, suppose we have been given the email IDs of 10 users who all need to be assigned to an application (let's say VEEVA). Is there any effective way of doing this through Postman API?

Related

Adding users to a public api without restricting the client

I am writing a public rest api, that uses api tokens that are one per application that uses it. I want to give the ability for the client to create users of the application, but not restrict them with what a user should be.
So I have API_USERS that need a token to authenticate to do any requests to the api. Lets say its an api for messages. So the messages from one application will be identified by that token, but how can I let the application that is using the api to be able to create their own users so that the messages in the database, are first uniquely identified for the application and then uniquely identified for the different users of the application if the application has such needs.
My idea is that I can just add another field like MESSAGE_OWNER and let the user handle how to create unique token for his users and maybe use his own database for storing users. Would that be a good solution? Is there another way I am not seeing?

How to Avoid Facebook Graph API Limit with million of users

I have a WordPress webpage with posts retrieving from a public Facebook page. The FB page is not mine. However the problem is that I have millions of visitors on my Web page and every time a user visits the web page it make an API call to FB Page. Since facebook allows only a limited number of API calls in a time frame, My limit reaches instantly with such a huge number of visitors. Is there any solution to this problem. an idea in my mind is:
1. retrieve posts from Facebook and store them locally and display them every time a user visits. Is it possible? If Yes where to start ?
Or can we get more API calls by paying facebook or things like that. I am ready to pay as far as my API calls can be made sufficient for my needs.
I am open to any solution and would be very thankful for any help to resolve the problem.
There are several possible solutions to this problem
Storing responses in database
You can add a middlepoint to your requests to Facebook API using your application. This would mean that you would have a database table which stores Facebook-related information, possibly along with a lifecycle time, like:
facebook_data(user_id, lifecycle_time, ...)
Whenever you would theoretically need to send a request to Facebook API, you can check the database table to see whether the user already has a record in that table and whether it is still valid. If so, give this data to the user. If not, send an API request to Facebook and store the response in this table.
Storing responses in localStorage/memory/file
You can also store Facebook-related data in the localStorage of the web browser of the memory of an app or a file, or even a local database specific for each user. This would prevent a lot of communication and server load your app is issuing on your server(s).
Queueing user requests to be sent
If the Facebook-related data is not very urgent to your users, you can queue requests to be sent and send a single request instead of a request for each user's each visit. You can do this via a cron job.
Periodically sending requests to Facebook
You can group your users into batches and periodically update their values via Facebook and storing in your database.
Combination
Naturally, you can combine the approaches, for instance, you can store in local memory, file, or localStorage values and in the database in the same time, so first locally stored information is searched for, not needing even a request if it exists and is still valid. If not, then checking the database record and using that if it exists and is still valid. And if the data is not found in local resources, nor your database, then you can send an API request.

Facebook marketing API - creating multiple ad sets

I'd like to create multiple (e.g. 20) ad sets via Facebook marketing API in web app. Of course Facebook has limitations and I can't do this straight. I spent a lot of time in testing. I'm waiting few minutes after I get error and retry request. But if I haven't ad-account error, faster or sooner I get user limit error.
How can I do this?
I can't catch requests containing multiple methods, because my request (creating ad sets, ad creatives) depends on campaign id. Otherwise it had to be a very big request.
I'm thinking about storing requests in session or database, but my requests depends each others.
You can use Batch requests:
https://developers.facebook.com/docs/marketing-api/batch-requests/v2.8
Example in python:
api_batch = account.get_api_assured().new_batch()
for whatever in whatever_list:
# Create the adset
adset = ....
adset.remote_create(batch=api_batch, failure=callback_failure)
api_batch.execute()

RESTful concurrent user management

I have a website in AngularJS. And a backend that is basically dumbed down to a RESTful API. Login currently works liket this:
User provides login credentials -> send to server -> Validate informations and deliver a token that will be used for future requests on the API. The API itself can be used anonymously as well.
Now I understand that in a RESTful environment, I shouldn't be using Sessions, but what if I wanted to show users that have been online in the last 15minutes? How would I determine if the user that was online within the last 15 minutes was authenticated or anonymous? I am not exactly looking for any code example but rather food for thought.
Thanks
I suggest you too add date field to user entity something like lastAccessDate and with every API request for user you update lastAccessDate to current date (now()).
To get all users that were active during last 15 minutes your just need to make query in your DB with condition: now() - lastAccessDate < 15 minutes
To track anonymous users you need to add separate entity guests, activities, shadow users, anonymous users could be good choice for that case.
Does this sound something helpful?

REST related query- for use in Java web app

I am trying to create a REST API using Java.
Now, for the front end, I am using socialauth, so that facebook/twitter/yahoo/hotmail/gmail users can sign in to the application.
After a user is signed in, he should be able to access the data for his account- I want to create a REST API that enables each user to access his data. I have understood the basics of creating a REST API using Jersey framework, however how do I ensure that only a user who is correctly logged in to the application, can access data via the REST API?
What I thought of is, I will store the user's email ID in session, when he logs in. And whenever he makes a request to the API, the email ID in session is passed as a input parameter to the REST API, and the REST API checks that data is asked for same email ID, as the email ID parameter.
Is the above way of thinking correct? What is the recommended/best way to implement REST API in the scenario as given above?