0

When I use postman to bounce the call off of my API it returns the error

"exception": "#",

I don't understand why I am getting this error at all, so I haven't really tried anything.

class NluCallsController < ApplicationController include IBMWatson require "json" require "ibm_watson/natural_language_understanding_v1" include DeriveText

def create
    @nlu_call = NluCall.new
    @nlu_call.url = params[:url]

    r = IBMWatson::NaturalLanguageUnderstandingV1.new(
        version: "2018-11-16",
        iam_apikey: ENV["NATURAL_LANGUAGE_UNDERSTANDING_IAM_APIKEY"],
        url: ENV["NATURAL_LANGUAGE_UNDERSTANDING_URL"]
    ).analyze(
        url: @nlu_call.url,
        features: {concepts: {limit:5}}
    )
    @nlu_call.response = r

    if @nlu_call.save!
        respond_to do |format|
            format.json @nlu_call.response
        end
    end
end

end

It should return a JSON object with the categories analyzed from the URL it is given. Instead it returns: NoMethodError (undefined method+' for nil:NilClass): because of this line: ).analyze(`

0 Answers0