Endpoints¶
This section assumes you have added the on-demand
url in urls.py as follows:
path('ondemand/', include('on_demand.urls')),
on-demand makes use of django-rest-framework to provide the following endpoints, and also to provide serializers for the models.
/search-suppliers¶
This is a GET endpoint that expects a search_term
parameter in free text. This will fire a lookup in the UserDetails model in the following property:
UserDetails.description
The response will be JSON type with a list of MentorProfiles that matched the lookup.
/users/<id>/supplier_profile¶
/users/<id>/consumer_profile¶
/newest-suppliers¶
/connection¶
supplier_id
consumer_id
objective: The goal of the connection (optional)
consumer_request_comments: Any comments the consumer added to the connection request (optional)
status: Status of the connection, it’ll be set to STARTED if not sent
connectionId: the id of the connection to update
status: the new status for the connection, the accepted statusses can be:
cancelled
finished: requires a ranking param, which is a numeric value given by the consumer.
ongoing
rejected: requires a rejection_reason which will contain a text value by the supplier explaining why the connection has been rejected