Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Authentication
Find out how many teams I am part of
Get team project list
Get project details
Get project topology
Get project disciplines
Upload project thumbnail
Create an issue in the project
Get the issue list from the project
Delete all the issues from the project
Create a new pin for the issue
Get all the pins of the issue
Create/Upload a new attachment for the issue
Get the attachment list from the issue

...

Deck of Cards
iddeleteIssueListCode
Card
labelObjectiveC
Code Block
borderColorGreen
langjava
titleJSON
//delete it form the server
	CommunicationSingleton *CSS = [CommunicationSingleton sharedSingleton];
	//create issue request:
	NSMutableURLRequest *deleteRequest = [[NSMutableURLRequest alloc] init];
            
	NSString *urlStringForIssue = [NSString stringWithFormat:@"%@%@/issues/%@",
                                           [CSS getDefaultAPIURL],
                                           [CSS getSlug],
                                           issueid];

	[deleteRequest setURL:[NSURL URLWithString:urlStringForIssue]];
	[deleteRequest setHTTPMethod:@"DELETE"];
	[deleteRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	[deleteRequest setValue:[CSS getAuthorization] forHTTPHeaderField:@"Authorization"];
            
	NSHTTPURLResponse *responseHTTPForDeletion;
	[NSURLConnection sendSynchronousRequest:deleteRequest returningResponse:&responseHTTPForDeletion error:&error];
	[deleteRequest release];
            
	if ([responseHTTPForDeletion statusCode] == 200) {

		//successful deletion
		return 0;

	} else {

	//add it to a deletion list
	[self addIssueToUnDeletedIssueList:issueid];

	return 1;

	}
Card
labelC#


Anchor
createNewPinCode
createNewPinCode

Create a new pin for the issue

Deck of Cards
iddeleteIssueListCode
Card
labelObjectiveC
Code Block
borderColorGreen
langjava
titleJSON

CommunicationSingleton *CSS = [CommunicationSingleton sharedSingleton];

	NSMutableDictionary *pinData = [self getPinDataForPinId:PIN_ID inIssue:ISSUE_ID];
	
	//remove the id and the objectsparent id since they are unrequired data for the server:
	NSString *oldObjectsParentID = [pinData objectForKey:@"objectsParentId"];
	[pinData removeObjectForKey:@"objectsParentId"];
	NSString *oldPinId = [pinData objectForKey:@"id"];
	[pinData removeObjectForKey:@"id"];
	
	//set the new issue id:
	[pinData setObject:newCurrentIssueId forKey:@"issueId"];
	
	//create nsdata for uploading:
	NSData *dataForCurrentPin = [NSJSONSerialization dataWithJSONObject:pinData options:NSJSONWritingPrettyPrinted error:&error];
                
	//create pin request:
	NSMutableURLRequest *uploadRequestForCurrentPin;
	uploadRequestForCurrentPin = [[NSMutableURLRequest alloc] init];
                
	NSString *urlStringForPin = [NSString stringWithFormat:@"%@%@/issues/%@/pins",
                                   [CSS getDefaultAPIURL],
                                   [CSS getSlug],
                                   self.newCurrentIssueID];
	
	[uploadRequestForCurrentPin setURL:[NSURL URLWithString:urlStringForPin]];
	[uploadRequestForCurrentPin setHTTPMethod:@"POST"];
	[uploadRequestForCurrentPin setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];
	[uploadRequestForCurrentPin setValue:[CSS getAuthorization] forHTTPHeaderField:@"Authorization"];
	[uploadRequestForCurrentPin setHTTPBody:dataForCurrentPin];
NSHTTPURLResponse *responseHTTPForCurrentPin;
                
	NSData *responseForCurrentPin = [NSURLConnection sendSynchronousRequest:uploadRequestForCurrentPin returningResponse:&responseHTTPForCurrentPin error:&error];
	[uploadRequestForCurrentPin release];
                
	if ([responseHTTPForCurrentPin statusCode] == 201) {
		// success
	} else {
		// Upload Failed
	}

Card
labelC#