PKAPIClient Class Reference
Inherits from | NSObject |
Conforms to | ASIHTTPRequestDelegate PKOAuth2ClientDelegate |
Declared in | PKAPIClient.h PKAPIClient.m |
Overview
Singleton class responsible for handling all API interaction, from authentication to request handling.
Tasks
-
– configureWithClientId:secret:
Configures the client for API access with the base URL string of https://api.podio.com
-
– configureWithClientId:secret:baseURLString:
Configures the client for API access.
-
– authenticateWithEmail:password:
Authenticate a user.
-
– refreshToken
Force a access token refresh with the current refresh token.
-
– refreshUsingRefreshToken:
Force a access token refresh with a particular refresh token.
-
– isAuthenticated
Checks if there client has a valid token.
-
– URLStringForPath:parameters:
Returns the full URL string for a path and a number of query parameters based on the configured base URL.
-
– addRequestOperation:
Add a request operation to the network queue.
-
– addFileOperation:
Add a file operation to the network queue.
Instance Methods
URLStringForPath:parameters:
Returns the full URL string for a path and a number of query parameters based on the configured base URL.
- (NSString *)URLStringForPath:(NSString *)path parameters:(NSDictionary *)parameters
Parameters
- path
The resource path.
- parameters
A dictionary of query parameters. The query parameter values have to be of type NSString.
Return Value
The full URL string.
Discussion
Returns the full URL string for a path and a number of query parameters based on the configured base URL.
Declared In
PKAPIClient.h
addFileOperation:
Add a file operation to the network queue.
- (BOOL)addFileOperation:(PKFileOperation *)operation
Parameters
- operation
The file operation.
Return Value
YES if the operation was added to the queue.
Discussion
Add a file operation to the network queue.
Declared In
PKAPIClient.h
addRequestOperation:
Add a request operation to the network queue.
- (BOOL)addRequestOperation:(PKRequestOperation *)operation
Parameters
- operation
The request operation.
Return Value
YES if the operation was added to the queue.
Discussion
Add a request operation to the network queue.
Declared In
PKAPIClient.h
authenticateWithEmail:password:
Authenticate a user.
- (void)authenticateWithEmail:(NSString *)email password:(NSString *)password
Parameters
The username.
- password
The password.
Discussion
Authenticate a user.
Declared In
PKAPIClient.h
configureWithClientId:secret:
Configures the client for API access with the base URL string of https://api.podio.com
- (void)configureWithClientId:(NSString *)clientId secret:(NSString *)secret
Parameters
- clientId
A Podio API client id.
- secret
A Podio API client secret for the corresponding client id.
Discussion
Configures the client for API access with the base URL string of https://api.podio.com
Declared In
PKAPIClient.h
configureWithClientId:secret:baseURLString:
Configures the client for API access.
- (void)configureWithClientId:(NSString *)clientId secret:(NSString *)secret baseURLString:(NSString *)baseURLString
Parameters
- clientId
A Podio API client id.
- secret
A Podio API client secret for the corresponding client id.
- baseURLString
The Podio API base URL string.
Discussion
Configures the client for API access.
Declared In
PKAPIClient.h
isAuthenticated
Checks if there client has a valid token.
- (BOOL)isAuthenticated
Return Value
YES if there is a valid token.
Discussion
Checks if there client has a valid token.
Declared In
PKAPIClient.h
refreshToken
Force a access token refresh with the current refresh token.
- (void)refreshToken
Discussion
Force a access token refresh with the current refresh token.
Declared In
PKAPIClient.h
refreshUsingRefreshToken:
Force a access token refresh with a particular refresh token.
- (void)refreshUsingRefreshToken:(NSString *)refreshToken
Parameters
- refreshToken
The refresh token to use to refresh the access token.
Discussion
Force a access token refresh with a particular refresh token.
Declared In
PKAPIClient.h