new MacarteAPI(apiURL)
Constructor
Parameters:
| Name | Type | Description |
|---|---|---|
apiURL |
string |
- Source:
- api/MacarteApi.js
Fires:
- event:login
- event:logout
- event:disconnect
- event:me
Members
-
<static, constant> api
-
Singleton API object to access the API
- Source:
- api/api.js
Methods
-
activateTeamMember(id)
-
Ativate team user NB: user must be an inactive member
Parameters:
Name Type Description idstring team id
- Source:
- api/MacarteApi.js
-
addTeamMember(id, userId, role)
-
Add members to the team
Parameters:
Name Type Argument Description idstring team id
userIdstring user id
rolestring user role (editor, owner, member)
options.callbackfunction <optional>
callback function
options.refreshboolean <optional>
get a refresh token
- Source:
- api/MacarteApi.js
-
checkTeam( [callback])
-
Check if current team is still valid (the user belong to it)
Parameters:
Name Type Argument Description callbackfunction <optional>
callback function that takes a boolean
- Source:
- api/MacarteApi.js
-
deleteMap(id, success)
-
Delete map and file
Parameters:
Name Type Description idstring map id
successfunction callback
- Source:
- api/MacarteApi.js
-
deleteMedia(id, callback)
-
Delete Media
Parameters:
Name Type Description idstring media to delete
callbackfunction when done
- Source:
- api/MacarteApi.js
-
deleteTeam(id)
-
Create a new team
Parameters:
Name Type Argument Description idstring team id
options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
dispatchEvent(event)
-
Dipatch an event
Parameters:
Name Type Description eventObject | string an object with a type property or an event type
- Source:
- api/MacarteApi.js
-
getArticleCategories(type, callback)
-
Get editorial categories
Parameters:
Name Type Description typestring callbackfunction - Source:
- api/MacarteApi.js
-
getArticles(category, callback)
-
Get articles of an editorial category
Parameters:
Name Type Description categorystring followers|megamenu
callbackfunction - Source:
- api/MacarteApi.js
-
getEditMap(id, success)
-
Get map information for a given id
Parameters:
Name Type Description idstring map id
successfunction callback
- Source:
- api/MacarteApi.js
-
getEditorial(type, callback)
-
Get editorial
Parameters:
Name Type Description typestring callbackfunction - Source:
- api/MacarteApi.js
-
getMap(id, success)
-
Get map information for a given id
Parameters:
Name Type Description idstring map id
successfunction callback
- Source:
- api/MacarteApi.js
-
getMapFile(id, success)
-
Get map file
Parameters:
Name Type Description idsting map id
successfunction callback
- Source:
- api/MacarteApi.js
-
getMaps(options)
-
Get the list of maps
Parameters:
Name Type Description options* Properties
Name Type Argument Default Description contextstring <optional>
profile search context atlas|profile|admin, default profile
querystring <optional>
Query string
themestring <optional>
organizationstring <optional>
premiumstring <optional>
'default' Premium 'default' or 'edugeo')
userstring <optional>
User public name
sortstring <optional>
'date' 'date', 'rank' or 'views'
limitnumber | string <optional>
maximum responses returned, an integer or 'all' to get all maps, default 'all' in context profile, 25 otherwise
offsetnumber <optional>
callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
getMe()
-
Get current user
- Source:
- api/MacarteApi.js
-
getMedias(options, callback)
-
Get user media
Parameters:
Name Type Description optionsObject search options
Properties
Name Type Argument Default Description teamboolean <optional>
true use false to get user media (out of current team)
callbackfunction - Source:
- api/MacarteApi.js
-
getMediasFolders(callback [, useTeam])
-
Get user media folders
Parameters:
Name Type Argument Default Description callbackfunction useTeamboolean <optional>
true use false to get user media folder (out of teams)
- Source:
- api/MacarteApi.js
-
getNotifications(callback404)
-
Get Notifications
Parameters:
Name Type Description callback404function - Source:
- api/MacarteApi.js
-
getPremium(edugeo)
-
Get user premium
Parameters:
Name Type Description edugeostring or default
- Source:
- api/MacarteApi.js
-
getRememberMe()
-
Are the credentials stored?
- Source:
- api/MacarteApi.js
Returns:
- Type
- boolean
-
getTeam(id)
-
Get team list NB: if not member, team members are not listed, only a count is returned
Parameters:
Name Type Argument Description idstring team id
options.callbackfunction <optional>
callback function
options.publiboolean <optional>
public information (no connection required)
- Source:
- api/MacarteApi.js
-
getTeamLinks(id)
-
Get member links
Parameters:
Name Type Description idstring team id
- Source:
- api/MacarteApi.js
-
getTeams()
-
Get my team list
Parameters:
Name Type Argument Description options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
getThemes(callback)
-
Get Themes
Parameters:
Name Type Description callbackfunction - Source:
- api/MacarteApi.js
-
getUser(public_id, success)
-
Get user info
Parameters:
Name Type Description public_idstring user id
successfunction callback
- Source:
- api/MacarteApi.js
-
getUsers(name, callback)
-
Autocomplete users
Parameters:
Name Type Description namestring public user name
callbackfunction - Source:
- api/MacarteApi.js
-
isConnected()
-
Check connection
- Source:
- api/MacarteApi.js
-
joinTeam(id)
-
Join a team using a link id
Parameters:
Name Type Description idstring link id
- Source:
- api/MacarteApi.js
-
login(user, pwd, callback)
-
Login: log the user and get user info Dispatch a login event
Parameters:
Name Type Description userstring pwdstring callbackfunction a function that returns the user info or an error
- Source:
- api/MacarteApi.js
-
logout(callback)
-
Logout
Parameters:
Name Type Description callbackfunction callback function
- Source:
- api/MacarteApi.js
-
newTeam(options)
-
Create a new team
Parameters:
Name Type Description optionsObject Properties
Name Type Argument Description namestring team name
presentationstring <optional>
team description
imagestring <optional>
image url for the team
callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
on(type, listener)
-
Add an event listener
Parameters:
Name Type Description typestring | Array.<string> an event type or an array of event type to listen to
listenerfunction a function that takes an event
- Source:
- api/MacarteApi.js
-
postMap(carte, data, success)
-
Save a new map
Parameters:
Name Type Description carteObject Properties
Name Type Argument Default Description typestring titlestring descriptionstring organization_idstring theme_idnumber premiumstring 'default' or 'edugeo'
activeboolean true sharestring private bboxArray.<number> img_urlstring <optional>
dataObject carte data
successfunction callback
- Source:
- api/MacarteApi.js
-
postMedia(img, folder, name, callback [, useTeam])
-
Post a new user media
Parameters:
Name Type Argument Default Description imgFile image file
folderstring namestring callbackfunction useTeamboolean <optional>
true - Source:
- api/MacarteApi.js
-
refreshToken(callback)
-
Refresh current token
Parameters:
Name Type Description callbackfunction - Source:
- api/MacarteApi.js
-
rememberMe(b)
-
Store current token
Parameters:
Name Type Description bboolean - Source:
- api/MacarteApi.js
-
removeTeamLink(id, type)
-
Remove the member link
Parameters:
Name Type Argument Description idstring team id
typestring 'member' or 'editor'
options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
removeTeamMember(id, userId [, callback])
-
Remove member from team
Parameters:
Name Type Argument Description idstring team id
userIdstring user id
callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
searchMapUsers(options, callback)
-
Search for users that publish a map
Parameters:
Name Type Description optionsObject Properties
Name Type Argument Default Description public_namestring <optional>
string contains in the public user name
themenumber <optional>
limitnumber <optional>
15 callbackfunction - Source:
- api/MacarteApi.js
-
setTeam(id, attr, value)
-
Set team attribute
Parameters:
Name Type Argument Description idstring team id
attrstring attribute to change (name, presentation, image)
valuestring attribute values
options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
setTeamLink(id, type)
-
Modify the member link
Parameters:
Name Type Argument Description idstring team id
typestring 'member' or 'editor'
options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
setTeamMemberRole(id, userId, role)
-
Modify member role in the team
Parameters:
Name Type Argument Description idstring team id
userIdstring user id
rolestring user role (editor, owner, member)
options.callbackfunction <optional>
callback function
- Source:
- api/MacarteApi.js
-
setToken(token [, refreshToken])
-
Set the current token
Parameters:
Name Type Argument Description tokenstring if none remove the current one
refreshTokenstring <optional>
- Source:
- api/MacarteApi.js
-
un(type, listener)
-
Remove an event listener
Parameters:
Name Type Description typestring | Array.<string> an event type or an array of event type to listen to
listenerfunction a function that takes an event
- Source:
- api/MacarteApi.js
-
updateMap(id, info, success)
-
Update map information for a given id
Parameters:
Name Type Description idstring map id
infoObject list of info to update
successfunction callback
- Source:
- api/MacarteApi.js
-
updateMapFile(id, data, callback)
-
Post a file media
Parameters:
Name Type Description idstring map edit id
dataObject carte data
callbackfunction when done
- Source:
- api/MacarteApi.js
-
updateMe(value, callback)
-
Update current user info
Parameters:
Name Type Description valueObject key value info
callbackfunction - Source:
- api/MacarteApi.js
-
updateMediaFile(id, img, callback)
-
Post a file media
Parameters:
Name Type Description idstring media to update
imgFile image file
callbackfunction when done
- Source:
- api/MacarteApi.js
-
updateMediaFolder(id, folder, callback)
-
Update media folder
Parameters:
Name Type Description idstring media to update
folderstring callbackfunction when done
- Source:
- api/MacarteApi.js
-
updateMediaName(id, name, callback)
-
Update media name
Parameters:
Name Type Description idstring media to update
namestring callbackfunction when done
- Source:
- api/MacarteApi.js
-
whoami(callback [, refresh])
-
Who is connected
Parameters:
Name Type Argument Default Description callbackfunction refreshboolean <optional>
true refresh token before send
- Source:
- api/MacarteApi.js