Skip to content

API-key instead of username/password #8

@thecite

Description

@thecite

I'm going through your tutorial at the moment, but have run into trouble regarding the code below.
My Watson Assistant and Language Translation services use API-key credentials instead of username/password (I believe this is due to a recent IBM Cloud update?).
How would I edit the code below to account for API-key credentials instead of username/password?

Would greatly appreciate your help,
regards.

`# set up conversation
try:
convCreds = params['__bx_creds']['conversation']
conversation = ConversationV1(
username=convCreds['username'],
password=convCreds['password'],
version='2018-02-16'
)
except:
return {
'message': 'Please bind your conversation service',
'context': '{}',
'output': '{}',
'intents': '{}',
'language': ''
}

# set up translator
try:
    ltCreds = params['__bx_creds']['language_translator']
    translator = LanguageTranslatorV3(
        version='2018-05-01',
        username=ltCreds['username'],
        password=ltCreds['password']
    )
except:
    return {
        'message': 'Please bind your language translator service',
        'context': '{}',
        'output': '{}',
        'intents': '{}',
        'language': ''

}`

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions