Where to get the Alchemyapi API key? - ibm-cloud

I'm doing the, Getting Started with AlchemyAPI Using Ruby, Ruby tutorial. But I cannot seem to find my API key.
Source: http://www.alchemyapi.com/developers/getting-started-guide/using-alchemyapi-with-ruby
At step 3:
3) Configure the Ruby SDK to use your API Key Now that you have the
Ruby SDK code on your computer, you need to do configure it to use
your API key. In the alchemyapi_ruby directory, run:
ruby alchemyapi.rb YOUR_API_KEY
Where YOUR_API_KEY is the 40 character API key you received in your
e-mail when you registered. If everything goes okay, you should see
the following output:
But I didn't get an API Key in an email...
The tutorial sent me to IBM Bluemix to register, which I have.
This is the email from signing up.
Hi XXX,
Thank you for signing up for Bluemix! During your trial, you'll have
access to Bluemix to build apps, with 2 GB of runtime and container
memory, as well as up to 10 provisioned Bluemix services. And, you
won't need to provide any form of payment for this trial.
Confirm your account to start your 30-day trial.
If you have any problems logging in, let us know at IBM Bluemix
Support.
Welcome to Bluemix!
--IBM Bluemix Team
After confirming - still no API Key. I've logged into the Bluemix site and have been searching around but also don't see it.
I apologize in advance if I've missed something obvious. But I'm wasting a lot of time here and would really appreciate any help :)
Has anyone signed up for this service recently and been able to get their API key. Can you tell me where it came from?

Login to Bluemix, go to Services & APIs. In Watson section chose AlchemyAPI and create one. After AlchemyAPI is created go to the dashboard and select created instance.
Under Service Credentials you can find the apikey:

After the acquisition of AlchemyApi by IBM the endpoints have changed hence the old legacy code in GitHub will not be able to use the key which you get from ibm bluemix.

Click on the watson --> then on the previously created credentials --> again click create. Then highlight the 'service credentials' to see the json format details.

Related

How to setup google service account authorization in Node.js with JSON key file?

Trying to make use of the Server to Server OAuth flow defined here:
https://developers.google.com/identity/protocols/OAuth2ServiceAccount
Since I'm running from a local dev environment, I've created a service account in GCP and downloaded the JSON file with the private key, but cannot find any Node.js code examples on how to:
1) load the json file
2) set delegated credentials (for G Suite domain-wide authorization)
Places I've looked (besides stackoverflow) are Google's git wiki for the node.js client library, which does talk about server to server auth, but seems to assume you're running from appengine or google cloud and don't need to load a key file:
https://github.com/googleapis/google-api-nodejs-client#service-to-service-authentication
The Admin SDK Activities Reports API has a Node example, but it's using the web-based flow assuming a user is present:
https://developers.google.com/admin-sdk/reports/v1/quickstart/nodejs
Buried deep in the Node.js samples is use of the Directory API, which does seem to take a keyfile as input, but when I try running locally it says getClient is not a constructor, and still this example doesn't show how to set the G Suite admin user for context (which is generally when a refresh token and access token are loaded into the app):
https://github.com/googleapis/google-api-nodejs-client/blob/master/samples/directory_v1/group-delete.js
So... does anybody have an example of this? I really don't want to switch to a Python runtime but Google seems to have left out important examples on this topic.

Google Cloud Storage 500 Internal Server Error 'Google::Cloud::Storage::SignedUrlUnavailable'

Trying to get Google Cloud Storage working on my app. I successfully saved an image to a bucket, but when trying to retrieve the image, I receive this error:
GCS Storage (615.3ms) Generated URL for file at key: 9A95rZATRKNpGbMNDbu7RqJx ()
Completed 500 Internal Server Error in 618ms (ActiveRecord: 0.2ms)
Google::Cloud::Storage::SignedUrlUnavailable (Google::Cloud::Storage::SignedUrlUnavailable):
Any idea of what's going on? I can't find an explanation for this error in their documentation.
To provide some explanation here...
Google App Engine (as well as Google Compute Engine, Kubernetes Engine, and Cloud Run) provides "ambient" credentials associated with the VM or instance being run, but only in the form of OAuth tokens. For most API calls, this is sufficient and convenient.
However, there are a small number of exceptions, and Google Cloud Storage is one of them. Recent Storage clients (including the google-cloud-storage gem) may require a full service account key to support certain calls that involve signed URLs. This full key is not provided automatically by App Engine (or other hosting environments). You need to provide one yourself. So as a previous answer indicated, if you're using Cloud Storage, you may not be able to depend on the "ambient" credentials. Instead, you should create a service account, download a service account key, and make it available to your app (for example, via the ActiveStorage configs, or by setting the GOOGLE_APPLICATION_CREDENTIALS environment variable).
I was able to figure this out. I had been following Rail's guide on Active Storage with Google Storage Cloud, and was unclear on how to generate my credentials file.
google:
service: GCS
credentials: <%= Rails.root.join("path/to/keyfile.json") %>
project: ""
bucket: ""
Initially, I thought I didn't need a keyfile due to this sentence in Google's Cloud Storage authentication documentation:
If you're running your application on Google App Engine or Google
Compute Engine, the environment already provides a service account's
authentication information, so no further setup is required.
(I am using Google App Engine)
So I commented out the credentials line and started testing. Strangely, I was able to write to Google Cloud Storage without issue. However, when retrieving the image I would receive the 500 server error Google::Cloud::Storage::SignedUrlUnavailable.
I fixed this by generating my private key and adding it to my rails app.
Another possible solution as of google-cloud-storage gem version 1.27 in August 2020 is documented here. My Google::Auth.get_application_default as in the documentation returned an empty object, but using Google::Cloud::Storage::Credentials.default.client instead worked.
If you get Google::Apis::ClientError: badRequest: Request contains an invalid argument response when signing check that you have dash in the project name in the signing URL (i.e projects/-/serviceAccounts explicit project name in the path is deprecated and no longer valid) and that you have "issuer" string correct, as the full email address identifier of the service account not just the service account name.
If you get Google::Apis::ClientError: forbidden: The caller does not have permission verify the roles your Service Account have:
gcloud projects get-iam-policy <project-name>
--filter="bindings.members:<sa_name>"
--flatten="bindings[].members" --format='table(bindings.role)'
=> ROLE
roles/iam.serviceAccountTokenCreator
roles/storage.admin
serviceAccountTokenCreator is required to call the signBlob service, and you need storage.admin to have ownership of the thing you need to sign. I think these are project global rights, I couldn't get it to work with more fine grained permissions unfortunately (i.e one app is admin for a certain Storage bucket)

Unable to create Kubernetes Cluster on IBM Bluemix

I have been trying to create a Kubernetes Cluster with my Bluemix account owner but always getting the following error upon creation:
IBM Cloud Infrastructure exception: Your account is currently prohibited from order 'Computing Instances'.
Any idea what the issue is? There seems to be no direct way to getting support from Public Bluemix to address this issue. We opened a ticket but it has not been addressed.
You should contact IBM Bluemix Support for this kind of question. Before you login to the Bluemix Console, there is a Support link.
From the look of the exception. It seen like you are trying to create a "second" kubernetes cluster. If this is what you are trying to do, you will need a SoftLayer account; or your ID in your SoftLayer account is not setup properly.
You need admin rights to create clusters in Bluemix. Just makes sure that you get the admin status and it should work for you. The normal permissions granted to you are that of an user. Hope this helps

IBMid SoftLayer linked user password automated reset

My question is basically the same as this question SoftLayer API OpenIdConnect Reset Password.
Once SoftLayer users are linked to IBM Bluemix users, the softlayer API can no longer be used to reset user passwords.
The only answer to the previous question indicates that "a bluemix api" must be used.
I've been searching for such an api but I'm not finding much, a million links for API design and connect on Bluemix but nothing for resetting the password in an automated fashion.
Can anyone point me to an API can can be used to reset or change the password for SoftLayer IBMid linked users?
Thanks!
Update:
I continue to search for a solution, I've downloaded and installed the BlueMix CLI and the Cloud Foundry CLI cf.
The bluemix CLI doesn't seem to have any password functionality, cf has a user password function but after prompting for Current Password and New and Confirm, it reports that current password doesn't match, which leads me to believe that the CF user functions are not tied to the IBMid open id server. (makes sense, just wanted to make sure and rule it out as an option)

Error linking IBM Bluemix Devops id to IBM Bluemix

I get the following error when linking IBM id to Bluemix:
IBM Bluemix
Failure during registration
An error occurred.
Try again in a few minutes. If you continue to have problems, click the following link to get help: https://developer.ibm.com/bluemix/support/
This is after following the email I received:
Hello there.
Your account requires attention
The authentication process for IBM Bluemix DevOps Services is integrating with IBM Bluemix. To ensure that you can continue to log in without disruption, register with Bluemix by taking a few steps.
SIGN UP
Step 1
Click SIGN UP
Step 2
Click Already have an IBM ID?
Step 3
Type your phone number and email address.
Step 4
Check your email to verify that you're registered. In the email, click Validate Email Address.
Step 5
Sign in by typing your IBM ID and password.
Step 6
Welcome to IBM Bluemix. You're done!
I have tried this a few times, and I'm not sure what I need to do next.
Please address the problem to Bluemix support using the following mail: id#bluemix.net. This team will assist you on this issue. Thanks.
Same problem here. But I realized that I already have registered in Bluemix.
So, right under "Already have an IBM ID?" there is: "Already signed up for Bluemix? Log in".
This "Log in" link points to login page which, after entering my credentials, it redirects to https://console.ng.bluemix.net/?direct=classic. I don't know what this argument "?direct=classic" means, but the page won't show. So I removed it and everything is working fine.