# Install the command line client
$ pip install coreapi-cli
# Install the Python client library
$ pip install coreapi
token
create
POST/en/api/token/
Request Body
The request body should be a "application/json" encoded object, containing the following items.
Parameter
Description
usernamerequired
Valid username for authentication
passwordrequired
Valid password for authentication
# Load the schema document
$ coreapi get http://www.contuga.eu/en/api/docs/
# Interact with the API endpoint
$ coreapi action token create -p username=... -p password=...
var coreapi = window.coreapi // Loaded by `coreapi.js`
var schema = window.schema // Loaded by `schema.js`
// Initialize a client
var client = new coreapi.Client()
// Interact with the API endpoint
var action = ["token", "create"]
var params = {
username: ...,
password: ...,
}
client.action(schema, action, params).then(function(result) {
// Return value is in 'result'
})
import coreapi
# Initialize a client & load the schema document
client = coreapi.Client()
schema = client.get("http://www.contuga.eu/en/api/docs/")
# Interact with the API endpoint
action = ["token", "create"]
params = {
"username": ...,
"password": ...,
}
result = client.action(schema, action, params=params)
create
users
create
POST/en/api/users/
Request Body
The request body should be a "application/json" encoded object, containing the following items.
Parameter
Description
emailrequired
passwordrequired
last_login
date_joined
# Load the schema document
$ coreapi get http://www.contuga.eu/en/api/docs/
# Interact with the API endpoint
$ coreapi action users create -p email=... -p password=... -p last_login=... -p date_joined=...
var coreapi = window.coreapi // Loaded by `coreapi.js`
var schema = window.schema // Loaded by `schema.js`
// Initialize a client
var client = new coreapi.Client()
// Interact with the API endpoint
var action = ["users", "create"]
var params = {
email: ...,
password: ...,
last_login: ...,
date_joined: ...,
}
client.action(schema, action, params).then(function(result) {
// Return value is in 'result'
})
import coreapi
# Initialize a client & load the schema document
client = coreapi.Client()
schema = client.get("http://www.contuga.eu/en/api/docs/")
# Interact with the API endpoint
action = ["users", "create"]
params = {
"email": ...,
"password": ...,
"last_login": ...,
"date_joined": ...,
}
result = client.action(schema, action, params=params)