Does someone have an idea why this script works from API Docs, but not from an actual API call (in my case from Android)
API_KEY = 'xxxxxxxxxxxxxxxxxx'
payload = event.request.payload
if payload:
if 'first_name' not in payload:
raise ValueError('User name field missing')
user_name = payload.first_name
if user_name == '':
raise ValueError('User name field required')
response = platform.api.get('system/user?api_key=' + API_KEY + '&filter=first_name%3D' + user_name)
response_string = response.read().decode('utf-8')
response_bunch = bunchify(json.loads(response_string))
if response_bunch.resource:
raise ValueError('User name is not available')
From API docs it works as expected. If a first name is taken, it says "user name not available". If there are no issues the user is registered as normal.
Calling from my Android app I always get the same response if this script is active.
{"error":{"context":null,"message":"resource","code":500,"trace":[....
Does someone have an idea why this script works from API Docs, but not from an actual API call (in my case from Android)
From API docs it works as expected. If a first name is taken, it says "user name not available". If there are no issues the user is registered as normal.
Calling from my Android app I always get the same response if this script is active.
{"error":{"context":null,"message":"resource","code":500,"trace":[....