Skip to content
Rjvs edited this page Sep 16, 2014 · 3 revisions

####Configuration

####First steps

 DIOSSession *sharedSession = [DIOSSession sharedSession];
 [sharedSession setBaseURL:[NSURL URLWithString:@"http://d8"]];
 [sharedSession setBasicAuthCredsWithUsername:@"admin" andPassword:@"pass"];

Currently only supports basic auth but will support oAuth soon

####Quick Examples

 //create new user
 NSDictionary *user = @{@"name":@[@{@"value":@"username"}],@"mail":@[@{@"value":@"email@gmail.com"}],@"pass":@[@{@"value":@"passw0rd"}]};
 [DIOSUser createUserWithParams:user success:nil failure:nil];

 //update existing node
 NSDictionary *node = @{@"uid":@[@{@"target_id":@"1"} ],@"body":@[@{@"value":@"Updated BOdy ",@"format":@"full_html"}],@"title":@[@{@"value":@"Updated Title"}]};
 [DIOSNode patchNodeWithID:@"12" params:node type:@"page" success:nil failure:nil];

 //create new comment
 NSDictionary *parameters = @{@"subject":@[@{@"value":@"comment title"}],@"comment_body":@[@{@"value":@"a new body",@"format":@"basic_html"}]};
 [DIOSComment createCommentWithParams:parameters relationID:@"7" type:@"comment" success:nil failure:nil];
 
 //get a user
 [DIOSUser getUserWithID:@"1" success:nil failure:nil];
 
 //delete a node
 [DIOSNode deleteNodeWithID:@"13" success:nil failure:nil];

####Extras

Drupal iOS SDK Addons

####OAuth

Coming soon

####Troubleshooting

If you are getting Forbidden, you probably havnt setup your permissions.

Clone this wiki locally