Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation for POST_api_objects_search #154

Closed
HadleyKing opened this issue Mar 7, 2023 · 0 comments
Closed

Documentation for POST_api_objects_search #154

HadleyKing opened this issue Mar 7, 2023 · 0 comments
Assignees
Labels
bug Something isn't working Critical

Comments

@HadleyKing
Copy link
Collaborator

HadleyKing commented Mar 7, 2023

Documentation forPOST_api_objects_search has not been published.

Their are two required values:

  1. type: can be one of 3 different values => mine | prefix | bco_id
  2. search:
  • This should be an empty string if you are doing the mine search as that is for "My BCOs"
  • For prefix it should be the name of the prefix.
  • For bco_id it should be some substring that is present in the desired bco_id or SET of bco_ids

An example of what you need to run is the following:

  • in shell:
curl -X POST "http://localhost:8000/api/objects/search/" -H  "accept: application/json" -H  "Authorization: Token c400a6076a2dfe7e9906ab86c6ad4574d1d60e03" -H  "Content-Type: application/json" -d "{\"POST_api_objects_search\":[{\"type\": \"prefix\",\"search\": \"TEST\"}]}"
  • in javascript:
axios.post("http://localhost:8000/api/objects/search/", {
  "POST_api_objects_search":[
    {
      "type": "prefix",
      "search": "TEST"
    }
  ]
}, {
    headers: {
      "Authorization": "Token c400a6076a2dfe7e9906ab86c6ad4574d1d60e03,
      "Content-Type": "application/json"
    }
});

Originally posted by @HadleyKing in #153 (comment)

@HadleyKing HadleyKing added bug Something isn't working Critical labels Mar 7, 2023
HadleyKing added a commit that referenced this issue Apr 10, 2023
Changes to be committed:
	modified:   api/views.py
HadleyKing added a commit that referenced this issue May 4, 2023
Changes to be committed:
	modified:   api/views.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Critical
Projects
None yet
Development

No branches or pull requests

3 participants