BitMEX / api-connectors

Libraries for connecting to the BitMEX API.
https://www.bitmex.com/app/restAPI
910 stars 795 forks source link

APIKey_get result #107

Closed cryptomite17 closed 6 years ago

cryptomite17 commented 6 years ago
import bitmex
client = bitmex.bitmex(test = False, api_key=[], api_secret=[])
client.APIKey.APIKey_get().result()

On the above code, I get this error: `/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado/http_future.py in wrapper(self, *args, *kwargs) 60 if timeout_errors: 61 try: ---> 62 return func(self, args, **kwargs) 63 except timeout_errors as exception: 64 six.reraise(

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado/http_future.py in result(self, timeout) 119 incoming_response, 120 self.operation, --> 121 self.response_callbacks) 122 123 swagger_result = incoming_response.swagger_result

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado/http_future.py in unmarshal_response(incoming_response, operation, response_callbacks) 154 incoming_response.swagger_result = unmarshal_response_inner( 155 response=incoming_response, --> 156 op=operation, 157 ) 158 except MatchingResponseNotFound as e:

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado/http_future.py in unmarshal_response_inner(response, op) 203 swagger_spec=op.swagger_spec, 204 schema_object_spec=content_spec, --> 205 value=content_value, 206 ) 207

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_schema_object(swagger_spec, schema_object_spec, value) 49 50 if obj_type == 'array': ---> 51 return unmarshal_array(swagger_spec, schema_object_spec, value) 52 53 if swagger_spec.config['use_models'] and \

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_array(swagger_spec, array_spec, array_value) 106 return [ 107 unmarshal_schema_object(swagger_spec, item_spec, item) --> 108 for item in array_value 109 ] 110

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in (.0) 106 return [ 107 unmarshal_schema_object(swagger_spec, item_spec, item) --> 108 for item in array_value 109 ] 110

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_schema_object(swagger_spec, schema_object_spec, value) 59 60 if obj_type == 'object': ---> 61 return unmarshal_object(swagger_spec, schema_object_spec, value) 62 63 if obj_type == 'file':

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_object(swagger_spec, object_spec, object_value) 142 result[k] = None 143 elif prop_spec: --> 144 result[k] = unmarshal_schema_object(swagger_spec, prop_spec, v) 145 else: 146 # Don't marshal when a spec is not available - just pass through

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_schema_object(swagger_spec, schema_object_spec, value) 49 50 if obj_type == 'array': ---> 51 return unmarshal_array(swagger_spec, schema_object_spec, value) 52 53 if swagger_spec.config['use_models'] and \

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_array(swagger_spec, array_spec, array_value) 106 return [ 107 unmarshal_schema_object(swagger_spec, item_spec, item) --> 108 for item in array_value 109 ] 110

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in (.0) 106 return [ 107 unmarshal_schema_object(swagger_spec, item_spec, item) --> 108 for item in array_value 109 ] 110

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_schema_object(swagger_spec, schema_object_spec, value) 59 60 if obj_type == 'object': ---> 61 return unmarshal_object(swagger_spec, schema_object_spec, value) 62 63 if obj_type == 'file':

/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/bravado_core/unmarshal.py in unmarshal_object(swagger_spec, object_spec, object_value) 126 if not is_dict_like(object_value): 127 raise SwaggerMappingError('Expected dict like type for {0}:{1}'.format( --> 128 type(object_value), object_value)) 129 130 object_spec = deref(object_spec)

SwaggerMappingError: Expected dict like type for <class 'str'>:order ` How to call it properly?

ryanfox commented 6 years ago

What are you trying to accomplish? APIKey_get is an authenticated function, you need to supply credentials when you create the client object.