You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See [coggle-issue-importer](http://github.com/coggle/coggle-issue-importer) for
5
5
a complete example application, including authentication.
6
6
@@ -15,25 +15,38 @@ coggle.createDiagram(
15
15
"My New Coggle"
16
16
function(err, diagram){
17
17
if(err)
18
-
raise err;
18
+
throw err;
19
19
console.log("created diagram!", diagram);
20
20
}
21
21
);
22
22
```
23
23
24
24
25
-
### API Documentation
25
+
# API Documentation
26
+
##Class `CoggleApi`
27
+
The Coggle API client.
26
28
27
-
#### CoggleApi
28
-
##### constructor
29
-
##### createDiagram
29
+
###Constructor
30
+
Create a new instance of the Coggle API client.
30
31
31
-
### CoggleApiDiagram
32
-
##### constructor
33
-
##### getNodes
34
-
##### webUrl
32
+
###Method `post`
33
+
POST to an endpoint on the Coggle API
35
34
36
-
#### CoggleApiNode
37
-
##### constructor
38
-
##### addChild
35
+
Parameters:
36
+
***`endpoint`** type: `String`URL of endpoint to post to (relative to the domain)
37
+
***`body`**The body to post. Will be converted to JSON.
38
+
***`callback`** type: `Function`Callback accepting (error, body) that will be called with the result. The response returned from the server is parsed as JSON and returned as `body`.
39
39
40
+
###Method `get`
41
+
GET from an endpoint on the Coggle API
42
+
43
+
Parameters:
44
+
***`endpoint`** type: `String`URL of endpoint to get from (relative to the domain)
45
+
***`callback`** type: `Function`Callback accepting (error, body) that will be called with the result. The response returned from the server is parsed as JSON and returned as `body`.
46
+
47
+
###Method `createDiagram`
48
+
Create a new Coggle diagram.
49
+
50
+
Parameters:
51
+
***`title`** type: `String`Title for the created diagram.
0 commit comments