I have a web application (Angular front, Laravel backend API). In that there is a section where I have messaging system. Basically four user roles can post and read messages.
When a user logged in I needs to check every 10 seconds to see if there are new messages for any user of any role(out of 4 roles).
This works fine but from time to time I get http status code of 429 Too many request. I have no idea what is the reason. Anyone have an idea of what is the reason or can point me to the right direction in order to fix this?
Note: I have a custom field system build and I use that to hold extra data of messages. I notice that when i fetch messages considerable number of models related to custom fields also quarried. Can this be a reason?
I found the solution and here are my steps.
I needed to find all my request going to the API, for that I installed this package API logger. Using this I examined the requests and there I found some request made to the API over and over.
I corrected the requests made to the API and the issue seems to fixed.
Related
For a laravel application that uses stripe, this request https://r.stripe.com/0 gets fired multiple times like so:
These requests got fired right after I refreshed the homepage.
The problem is that I recently got a 429 too many requests error in my live server. This is pretty rare but I suspect it has something to do with stripe since I read about rate-limiting in stripe.
Since I am new to stripe and I got this project handed over midway, I had some questions:
Is there any relation between the 429 error and these stripe requests? Or is this something to do with the way the system is built?
If it's the former, how would one resolve the issue? Maybe disable the security checks (cause I read somewhere that these requests were stripe security checks), or maybe increase the rate limit from stripe in some way?
I searched extensively about this but couldn't find any relevant posts anywhere, maybe because it's a very trivial problem. I would be grateful if someone who has faced this or knows about this can enlighten me.
I have a Laravel back end serving APIs to a React front end for a solution I am developing. I want to integrate SendBird Chat API into the application to allow authenticated users to chat with each other.
My query is, how can I pass authenticated user details to SendGrid? I.e., if user X and user Y both log into the website, how do I allow them to talk to each other?
I am pretty sure I've misunderstood something around sessions but any help is appreciated.
I am not looking for a specific code answer but a general architectural answer.
You send request from your frontend app, Laravel API receives request, builds whole application (all of your code) to process it and returns response. That is one request lifecycle and Auth::user() is going to be the user which sent request.
Request lifecycle explains this in much more detail but I recommend first learning about the basics of Client <-> Server architecture
We are using BotFramework Composer to create bots. These bots are supposed to get information from a backend REST service, where we need to know, which user is submitting the request for data. We are currently using {turn.activity.from.id} to get the Teams user's id, and sending it in a special http header in the "Send an HTTP request" action. We then perform a mapping of this id to our internal users.
We are, of course, aware, that this is not secure at all, since anyone who knows this, could get the user's id and send it to our service. We are currently thinking along the lines of generating a short-lived jwt token in the Bot to send to our application. However, we see no direct way of implementing this token generation in the Bot Framework Composer itself.
Also, we don't want to use OAuth, because we don't want the user to have to log in via the bot.
Is there a way to implement custom token generation using C# or js and assigning it to a dialog variable to be used in a "Send an HTTP request" action?
This document discusses how to implement an HTTP request in Composer. The first half is focused on creating a login for OAuth, which I know is not your focus, so look at the second half. If you set up a simple server that can generate a token for you, then you can make a request to it from Composer using the method described.
As links can break and docs can change (and Composer is still in Preview), I would recommend saving the doc somewhere and checking back every so often for any updates.
I've used HTTP requests from within Composer, myself, so I know this will work for you.
Hope of help!
You can create a custom Action or a package component and create any c# methods there for JWT generation. This will keep it all local to the bot.
https://learn.microsoft.com/en-us/composer/how-to-create-custom-actions
We have Intermec CK71 mobile devices (WiFi). There will always be a scenario in which the device sends a request (GET, PUT, or POST), then loses connection. What methods can we use to prevent duplicate PUTs or POSTs? How does the client device know whether or not the server processed its request before losing the connection?
I have seen similar posts like this but the marked answer doesn't go into much detail. I'm not even sure where to begin. Should I be looking into caching (ETag, last modified), or some type of handshaking?
The client device has the .Net Compact Framework 3.5 on it and is hitting the server via its Web API 2 endpoints.
If someone can point me to the right direction or offer any suggestions it would be much appreciated. Thanks.
I am not using REST but as far as I read the information there is no easy way to get an acknowledge and avoid duplicate POST.
As with other high level API frameworks you are tied to what the API offers and it looks like the designers did not think about connection aborts.
The easiest way to workaround this seems to use an unique ID with every post and check the server for knowing these UID before re-posting. If the server does not response with OK for an POST, you have to assume the connection has broken or other things went wrong. Then query the server for the UID you posted to know if the pervious POST was succesful before you try another POST with the same data and UID.
Possibly there is some transaction encapsulation available with REST as available for sql server. A 'transaction' protocol would ensure that a POST has been processed succesfully or will be 'rolled' back, if something failed.
Sorry, but I do not know much about REST.
We have developed an application to extract data from Yammer using the Yammer APIs. We're authenticating using the verified admin's credentials. According to the data export CSV file we know that there are some 25K messages in the network, but we only get 10K messages via the API. Initially thought that the difference was private messages, but the missing messages are a mix of private and public messages.
The API call we are using is: https://www.yammer.com/api/v1/messages.json . We are using the 'older_than' parameter to scan through all the messages.
In the end we had to query the missing messages individually but that is not a very efficient process.
Any ideas about what we could be doing wrong, or why the APIs are missing to many messages?
I'm experiencing the same issue. Even by respecting the API Rate limits there are some messages that are not retrieved. By using /api/v1/messages/about_topic/ I can get them all.
The issue is not linked to the age of messages. Most of the missing ones a quite new.
You can't download all messages via the API call you're using.
Reference https://stackoverflow.com/a/19107426/4099849
If you attempt to iterate over messages you will hit some limits. These limits are technical in nature and you would need to revert to the search API to find much older messages. Unfortunately you will have to put up with these limitations if you are dealing with the free version of Yammer as the data export is only available with the paid version.