🔙 Callback

Get data from uutside Naas network easily, usefull for OAuth and other stuff

Create

Create callback url

url, uuid = naas.callback.add()

Create without self destroy

url, uuid = naas.callback.add(autoDelete=False)

Create with custom response

url, uuid = naas.callback.add(response={"toto": "tata"})

Create with custom response headers

url, uuid = naas.callback.add(responseHeaders={"toto": "tata"})

List

You can list all callback you have create

df = naas.callback.list()

Get

You can get a callback result.

if callback didn't been call yet, result will be None

data, headers = naas.callback.get(uuid)

Wait until data present

It will wait maximum 3000 sec

data, headers = naas.callback.get(uuid, True)

Wait until data present with Timeout

timeout is in seconds

data, headers = naas.callback.get(uuid, True, 10)

Get the full data

data = naas.callback.get(uuid, raw=True)

Delete

You can remove any callback by uuid.

naas.callback.delete(uuid)

List all (Admin)

Allows retrieving the all callback made by all users as admin.

import naas
naas.callback.list_all()