Advisor Viewers (deprecated) ============================ Manage the mapping of advisors to viewers. .. warning:: Advisors have been retired as of August 2022. Please use Dashboards. Linked From: * :doc:`root` PUT or PATCH ------------ The ``PUT`` method is used to upload a file of mappings that should replace all of the mappings that already exist. The ``PATCH`` method is used to upload a file of mappings that should augment the mappings that already exist. A 200 response is returned if the upload was successfully processed. The mappings will be saved even if there are viewers missing. The response will contain details outlining any missing viewers. Accepted Request Content-Types: ``text/csv``, ``application/json`` Note: Be sure to include the encoding using the ``charset`` content type parameter, so that we can properly interpret your upload. We highly recommend using ``utf-8`` if possible. Available Response Content-Types: ``application/json`` Example Request ~~~~~~~~~~~~~~~ URL: ``/detective/api/advisor/viewer/`` Content-Type: ``text/csv`` .. code-block:: text advisor_id,advisor_sis_id,viewer_id,viewer_sis_id,viewer_is_ally 1,,2,, ,3,,4,True 5,,,6,False ,7,8,,True URL: ``/detective/api/advisor/viewer/`` Content-Type: ``application/json`` .. code-block:: json [ {"advisor_id": "1", "viewer_id": "2"}, {"advisor_sis_id": "3", "viewer_sis_id": "4", "viewer_is_ally": true}, {"advisor_id": "5", "viewer_sis_id": "6", "viewer_is_ally": false}, {"advisor_sis_id": "7", "viewer_id": "8", "viewer_is_ally": true} ] Example Success Response ~~~~~~~~~~~~~~~~~~~~~~~~ URL: ``/detective/api/advisor/viewer/`` Status: 200 OK Request Content-Type: ``application/json`` .. code-block:: json { "detail": "Some advisors or viewers could not be found.", "missing": { "advisor_id": ["1", "5"], "advisor_sis_id": ["3", "7"], "viewer_id": ["2", "8"], "viewer_sis_id": ["4", "6"] } } Example Error Response ~~~~~~~~~~~~~~~~~~~~~~ Status: 422 Unprocessable Entity Content-Type: ``application/json`` .. code-block:: json { "detail": "No advisor mappings were given." }