How long to wait for get api key or response from developer#support from BestBuy? - best-buy-api

How long to wait for get api key or response from developer#support from BestBuy?
I get a message with some text in https://developer.bestbuy.com/secure/dashboard:
"The admin for your company has been notified of your request and you will need to be approved."

I get a new request with my domain email and i get a new api key. You need to specify the domain's mail and no other and you will get a key in a few minutes.

Related

Trying to use adminp.DeleteReplicas followed by adminp.ApproveReplicaDeletion gives error "Invalid Approval Request note"

I am trying delete a database and any associated replicas using LotusScript adminp calls. This is basically the code:
Dim session As New NotesSession
Dim adminp As NotesAdministrationProcess
Set adminp = session.CreateAdministrationProcess("Software_Server")
noteid$ = adminp.DeleteReplicas("Software_Server", "Guys1")
If noteid$ <> "" Then
Call adminp.ApproveReplicaDeletion(noteid$) 'This is where the error is thrown
End If
The first adminp call is successful and returns a noteid, and if I look in the admin requests database can see the document. The next call to ApproveReplicateDeletion results in the error "Invalid Approval Request note"
The documentation doesn't contain any examples for the adminp approve methods. I have a feeling that maybe the second request cannot be called until much later when adminp has processed the first request?
Also related question, do I only have to make this request on a single server and it will remove replicas on all other servers, or do I need to make this request for each server?
So this is a bit more complicated than the help gives any indication of, and might explain why I couldn't find any examples on the internet on how to do it. So the Workflow for using AdminP is as Follows:
Create the request to get the noteID for the initial noteid of the DeleteReplicas request. The returned noteID is not the one that is used to approve the delete replica request. noteid$ = adminp.DeleteReplicas("Software_Server", "Guys1")
This creates a document in the admin.nsf db for the initial request, but the approval docs don't yet exist, for the server to create those, the adminp process must run.
So in the code send a Console command to the Server "tell adminp process now"
Sleep the agent for a few seconds to give adminp time to process the request (this will also fire off any other waiting adminp requests unfortunately)
Now new documents will have been created in the admin database, that are awaiting approval by an admin. These documents contain the noteids that should be sent the approvereplicadeletion
To get them, first lookup the notes document by the noteID in the admin db obtained in step 1
Using that noteid for the document, get the field value ProxyOriginatingRequestUNID from the document.
using this UNID value, perform a getalldocumentsbykey on the view ($AllRequestsbyOriginatingUNID)
if the returned document has a ProxyAction field with a value of "82", this is an approval request document. This documents noteid can be passed to approveReplicaDeletion to have adminp remove the database next time it processes requests.
You can either send a console command to process adminp again, or just wait for the database deletions etc. to happen next time around.

Wait for a thread to finish before passing the value

I am coding a telegram bot that can search Wikipedia with telegram api and vb.net. If someone sends a message saying "wiki xyz" (telegram api, Onmessage)bot gives info about xyz. The problem is about simultaneous messages, if a user with a specific chat ID requests a wiki search and while its in progess if a second (or even third) requests the same then the chat ID and the wiki search term gets mixed up. How to wait for the first user's request being processed and sent before processing the second(or even 3rd) request?
Here is the code
Private Async Sub OnMessageReceived(sender As Object, e As MessageEventArgs)
Dim sender As String = e.Message.From.Id.ToString
Dim msg As String = e.Message.Body.toString
If msg.StartsWith("wiki") Then
Dim query as String= msg.replace("wiki","")
'''do Wikipedia search with query and sending the reply to sender
Await sendMessage(sender, formattedWikitxt.ToString)
End If
the problem is that while receiving simultaneous requests, the variables "sender" and "query" gets changed before the message is delivered and users are getting some other query in reply instead. How to make this task wait before the first user receives message before processing the request of the second(or even 3rd)?

How to extract sessionId from Citrus HttpRequest

I tried to test the a set of REST services using Citrus Java DSL. After authentication the services expect the same, valid session id of the first request.
On the server side I can see, that there exists a random session-id, but at the second request, the session-id is null.
I've tried to set handleCookies to true in the endpoint configuration and tried to extract some header information (set-cookie) but without success. The EndpointConfiguration is reused during the different requests.
CitrusEndpoints.http()
.client()
.handleCookies(true)
How can I force the Endpoint to reuse the negotiated session-id or how can I extract it from the request / response?
Thanks in advance for any ideas and hints.
The response to your 1st request should have a header set
Set-Cookie: JSESSIONID=ABCDEFG;path=/api/foo
You can extract this information in your receive operation
http()
.client(todoClient)
.receive()
.response(HttpStatus.OK)
.extractFromHeader("Set-Cookie", "cookie")
.payload("{ \"foo\": \"bar\" }");
After that we have to post process the new ${cookie} value in order to extract the actual session id name and value into a new variable ${sessionId}.
createVariable("sessionId", "citrus:substringBefore(${cookie}, ';')");
Now we have a variable ${sessionId} that only contains the name and value of the session id - in our example this is JSESSIONID=ABCDEFG.
In further requests you can use the variable in order to set proper Cookie header information
http()
.client(todoClient)
.send()
.get("/api/foo")
.header("Cookie", "${sessionId}")
.accept(ContentType.APPLICATION_JSON.getMimeType());

Send DELETE request to an API endpoint using Nestful Sinatra

I want to send a DELETE request to an external API endpoint in a controller of my Sinatra application using nestful gem. I want to delete an event by sending a DELETE request to an endpoint of TeamSnap API. I have defined the following route in controller:
delete '/events/:id' do
delete 'https://api.teamsnap.com/v3/events/76674685'
end
When the API endpoint is hit with delete action, I get the following error:
*** "Delete" argument "endpoint" needs to be a number
If I send a get request to the API endpoint, I get the correct response. The get request I am using is given below:
get '/events/:id' do
get 'https://api.teamsnap.com/v3/events/76674685'
end
Can anyone confirm how can we send the DELETE request in the controller and what I am missing?
Thanks in advance!
[Solved]: I sent a DELETE request through Nestful using the following commands:
delete '/events/:id' do
request = Nestful::Request.new(endpoint, options)
request.method = 'delete'
response = request.execute
end
In the above piece of code, endpoint is "https://api.teamsnap.com/v3/events/EVENT_ID" and options is a hash which contains "Content-Type" and "Authorization" headers.

WSO2 Send Recovery Notification

In our current WSO2 setup, after a user performs a self creation, we place his account into a locked state, and send a confirmation email to the address specified during creation. This email has a link which allows the user to verify his account.
For development purposes, we are attempting to get the workflow down using the UserInformationRecoveryService wsdl in SOAP UI. The service which we seem to want is called sendRecoveryNotification. Here is the signature of this service:
sendRecoveryNotification(String username, String key, String notificationType)
The username parameter is simply the username of the WSO2 user in question, which we have. For the notificationType we have been using email, which presumably would trigger an email to be sent to the user. The problem is with the key parameter. It is not clear what value should be used as key, and all our guesses always lead to this error response:
18001 invalid confirmation code for user : tbiegeleisen#abc.com#tenant.com
We also noticed that several other services also expect a key, and it is not clear how to get this value.
Can someone shed light on the workflow for user recovery in WSO2? It seems to be a Catch-22 with regard of requiring a token in order to generate a new token to be sent to a user.
The WSO2 documentation clearly spells out the workflow for recovery with notification. The key which needs to be used is the return value from a call to the verifyUser() SOAP web service. This service itself expects a Captcha which normally would be sent from the UI. Here is a code snippet showing how a recovery notification can be sent:
String cookies = client.login("admin#tenant.com#tenant.com", "admin");
UserInformationRecoveryUtil userInfoutil = new UserInformationRecoveryUtil(webserviceUrl, cookies);
CaptchaInfoBean captchaInfo = new CaptchaInfoBean();
captchaInfo.setImagePath(captchaPath);
captchaInfo.setSecretKey(captchaKey);
captchaInfo.setUserAnswer(captcha);
String username = emailId + "#" + tenantDomain;
String key = userInfoutil.verifyUser(username, captchaInfo);
// now pass the key based on the Captcha along with the type of recovery action
userInfoutil.sendRecoveryNotification(username, key, "accountUnLock");