Skip to content

Latest commit

 

History

History
280 lines (198 loc) · 9.41 KB

SWGChatApi.md

File metadata and controls

280 lines (198 loc) · 9.41 KB

SWGChatApi

All URIs are relative to https://www.bitmex.com/api/v1

Method HTTP request Description
chatGet GET /chat Get chat messages.
chatGetChannels GET /chat/channels Get available channels.
chatGetConnected GET /chat/connected Get connected users.
chatGetPinnedMessage GET /chat/pinned Get pinned message for a channel.
chatNew POST /chat Send a chat message.

chatGet

-(NSURLSessionTask*) chatGetWithCount: (NSNumber*) count
    start: (NSNumber*) start
    reverse: (NSNumber*) reverse
    channelID: (NSNumber*) channelID
        completionHandler: (void (^)(NSArray<SWGChat>* output, NSError* error)) handler;

Get chat messages.

Example

NSNumber* count = @100; // Number of results to fetch. (optional) (default to 100)
NSNumber* start = @0; // Starting ID for results. (optional) (default to 0)
NSNumber* reverse = @true; // If true, will sort results newest first. (optional) (default to true)
NSNumber* channelID = @1; // Channel id. GET /chat/channels for ids. Global English by default (optional) (default to 1)

SWGChatApi*apiInstance = [[SWGChatApi alloc] init];

// Get chat messages.
[apiInstance chatGetWithCount:count
              start:start
              reverse:reverse
              channelID:channelID
          completionHandler: ^(NSArray<SWGChat>* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling SWGChatApi->chatGet: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
count NSNumber* Number of results to fetch. [optional] [default to 100]
start NSNumber* Starting ID for results. [optional] [default to 0]
reverse NSNumber* If true, will sort results newest first. [optional] [default to true]
channelID NSNumber* Channel id. GET /chat/channels for ids. Global English by default [optional] [default to 1]

Return type

NSArray*

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

chatGetChannels

-(NSURLSessionTask*) chatGetChannelsWithCompletionHandler: 
        (void (^)(NSArray<SWGChatChannel>* output, NSError* error)) handler;

Get available channels.

Example

SWGChatApi*apiInstance = [[SWGChatApi alloc] init];

// Get available channels.
[apiInstance chatGetChannelsWithCompletionHandler: 
          ^(NSArray<SWGChatChannel>* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling SWGChatApi->chatGetChannels: %@", error);
                        }
                    }];

Parameters

This endpoint does not need any parameter.

Return type

NSArray*

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

chatGetConnected

-(NSURLSessionTask*) chatGetConnectedWithCompletionHandler: 
        (void (^)(SWGConnectedUsers* output, NSError* error)) handler;

Get connected users.

Returns an array with browser users in the first position and API users (bots) in the second position.

Example

SWGChatApi*apiInstance = [[SWGChatApi alloc] init];

// Get connected users.
[apiInstance chatGetConnectedWithCompletionHandler: 
          ^(SWGConnectedUsers* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling SWGChatApi->chatGetConnected: %@", error);
                        }
                    }];

Parameters

This endpoint does not need any parameter.

Return type

SWGConnectedUsers*

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

chatGetPinnedMessage

-(NSURLSessionTask*) chatGetPinnedMessageWithChannelID: (NSNumber*) channelID
        completionHandler: (void (^)(SWGPinnedMessage* output, NSError* error)) handler;

Get pinned message for a channel.

Example

NSNumber* channelID = @1.2; // 

SWGChatApi*apiInstance = [[SWGChatApi alloc] init];

// Get pinned message for a channel.
[apiInstance chatGetPinnedMessageWithChannelID:channelID
          completionHandler: ^(SWGPinnedMessage* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling SWGChatApi->chatGetPinnedMessage: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
channelID NSNumber*

Return type

SWGPinnedMessage*

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]

chatNew

-(NSURLSessionTask*) chatNewWithMessage: (NSString*) message
    channelID: (NSNumber*) channelID
        completionHandler: (void (^)(SWGChat* output, NSError* error)) handler;

Send a chat message.

Example

SWGDefaultConfiguration *apiConfig = [SWGDefaultConfiguration sharedConfig];

// Configure API key authorization: (authentication scheme: apiExpires)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api-expires"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api-expires"];

// Configure API key authorization: (authentication scheme: apiKey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api-key"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api-key"];

// Configure API key authorization: (authentication scheme: apiSignature)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"api-signature"];
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"api-signature"];


NSString* message = @"message_example"; // 
NSNumber* channelID = @1; // Channel to post to. Default 1 (English). (optional) (default to 1)

SWGChatApi*apiInstance = [[SWGChatApi alloc] init];

// Send a chat message.
[apiInstance chatNewWithMessage:message
              channelID:channelID
          completionHandler: ^(SWGChat* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling SWGChatApi->chatNew: %@", error);
                        }
                    }];

Parameters

Name Type Description Notes
message NSString*
channelID NSNumber* Channel to post to. Default 1 (English). [optional] [default to 1]

Return type

SWGChat*

Authorization

apiExpires, apiKey, apiSignature

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded
  • Accept: application/json, application/xml, text/xml, application/javascript, text/javascript

[Back to top] [Back to API list] [Back to Model list] [Back to README]