Answers.Body: <p>sort option takes the parameter followed by <code>sort_order</code> in civicrm api.</p>
  
  <p>For eg - the following works fine -</p>
  
  <p><a href="https://i.sstatic.net/W5twQ.png" rel="noreferrer"><img src="https://i.sstatic.net/W5twQ.png" alt="enter image description here"></a></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-09-26T17:10:11.043Z
Answers.Text: I believe it is here https://docs.civicrm.org/dev/en/latest/api/v3/options/#optionssort for those interested in documentation reading.
Answers.UserDisplayName: yurg
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-05T03:17:41.153Z
Answers.LastActivityDate: 2019-02-05T03:17:41.153Z
Answers.UserDisplayName: jitendra - fuzion
Body: <p><a href="https://i.sstatic.net/JkZ2e.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JkZ2e.png" alt="enter image description here"></a>
  I need to find the external identifier with highest value and hence need to sort in descending order .So I need to use sorting feature but unaware of what value should be added in screenshot shown.I tried with 'desc' but it gives an error.</p>
  
Tags: <api><external-id>
Title: How to sort in descending order the results of CiviCRM API
ThreadText: # How to sort in descending order the results of CiviCRM API
  
  (Asked by: username_0 on 2019-02-04)
  
  [![enter image description here](https://i.sstatic.net/JkZ2e.png)](https://i.sstatic.net/JkZ2e.png)
  I need to find the external identifier with highest value and hence need to sort in descending order .So I need to use sorting feature but unaware of what value should be added in screenshot shown.I tried with 'desc' but it gives an error.
  
  **Tags:** api, external-id
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-05. Score: 5 | Accepted answer
  
  sort option takes the parameter followed by `sort_order` in civicrm api.
  
  For eg - the following works fine -
  
  [![enter image description here](https://i.sstatic.net/W5twQ.png)](https://i.sstatic.net/W5twQ.png)
  
  > **Comments:**
  > **username_2**: I believe it is here https://docs.civicrm.org/dev/en/latest/api/v3/options/#optionssort for those interested in documentation reading.  
  
  ---
  
  