Score

thomasbonte edited this page Mar 29, 2013 · 38 revisions
Clone this wiki locally
Resource Method
/score GET, POST
/score/{id} GET, DELETE
/score/{id}/space GET
/score/{id}/time GET
score/{id}/comment (in development)

GET /score

Type: Collection of Scores

Retrieves all scores.

Parameters

Name Type Description
text string a string to search for (use double quotes to do literal string matching)
part integer [-1;-128] a midi program number, zero based indexed. Drumset is 128 and -1 is undefined
parts integer the number of parts in the score. 1 for solo scores. 2 for duo etc…
language 2 letters language code Lyric language
page integer Zero based index of the result page. Pages contain 20 results.

An unauthenticated request shows only public scores while an authenticated one will show all the scores the logged user has access to.

GET /score/{id}

Type: Score

Retrieves a given score.

Parameters

Name Type Description
secret string

If the user is authenticated, the secret is not needed to access public resources. See OAuth for authentication.


$ curl http://api.musescore.com/services/rest/score/583.xml?oauth_consumer_key=your_consumer_key
< HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<score>
  <score_id>583</score_id>
  <secret>624a6e663e</secret>
  <uri>http://api.musescore.com/services/rest/score/583</uri>
  <uid>5</uid>
  <title>Wilder Reiter</title>
  <description>...</description>
  <pages>1</pages>
  <measures>26</measures>
  <length>29</length>
  <dimensions>210x297</dimensions>
</score>

GET /score/{id}/space

Send back the bounding boxes around the measures in the graphical representation. A scaling factor may apply. (12 for PNG).

Parameters

Name Type Description
secret string

If the user is authenticated, the secret is not needed to access public resources. See OAuth for authentication.


$ curl http://api.musescore.com/services/rest/score/583/space.xml?oauth_consumer_key=your_consumer_key
< HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
  <elements is_array="true">
    <element>
       <id>0</id>
       <x>1183.1868963254592</x>
       <y>2356.5019173228343</y>
       <sx>1014.2236806299212</sx>
       <sy>1321.9491732283464</sy><page>0</page>
    </element>
    <element><id>1</id>...</element>
  </elements>

x and y are the coordinates of the measures in the page.
sx and sy are the width and the height of a measure.

GET /score/{id}/time

Send back a list of events with timestamps in the mp3 or MIDI representation of the score and ids of the measures from the space representation.

Parameters

Name Type Description
secret string

If the user is authenticated, the secret is not needed to access public resources. See OAuth for authentication.


$ curl http://api.musescore.com/services/rest/score/583/time.xml?oauth_consumer_key=your_consumer_key
< HTTP/1.1 200 OK

<?xml version="1.0" encoding="utf-8"?>
<events is_array="true">
    <event>
      <elid>0</elid>
      <position>0</position>
    </event>
    <event>
      <elid>1</elid>
      <position>250</position>
    </event>
    <event>
       <elid>2</elid>
       <position>1159.090909090909</position>
    </event>
   ...
 </events>

POST /score

Creates a score belonging to the logged in user. Since a file asset is attached the request must be a ‘multipart/form-data’ request.

Parameters

Name Type Description
score_data file, required the score file, mscz format only
title string, required Title of the score
description string Description for the score
private boolean 1: private ; 0: public
license string Enumeration: (all-rights-reserved, cc-by, cc-by-sa, cc-by-nd, cc-by-nc, cc-by-nc-sa, cc-by-nc-nd, publicdomain, cc-zero)
tags string comma separated list of tags

DELETE /score/{score_id}

Deletes the given score

$ curl 'http://api.musescore.com/score/17?oauth_consumer_key=your_consumer_key' -X DELETE

< HTTP/1.1 200 OK