distribution.subscription.post
curl --request POST \
--url 'https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=' \
--header 'Content-Type: application/json' \
--data '
{
"partner_user_id": "123456",
"plan_id": "artist-plus-annual"
}
'import requests
url = "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey="
payload = {
"partner_user_id": "123456",
"plan_id": "artist-plus-annual"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({partner_user_id: '123456', plan_id: 'artist-plus-annual'})
};
fetch('https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_user_id' => '123456',
'plan_id' => 'artist-plus-annual'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey="
payload := strings.NewReader("{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=")
.header("Content-Type", "application/json")
.body("{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"header": {
"status_code": 201,
"execute_time": 0.32
},
"body": {
"subscription": {
"user_id": "mxm:123456789012345678901",
"plan_id": "artist-plus-annual",
"status": "active"
}
}
}
}{
"message": {
"header": {
"status_code": 123,
"execute_time": 123
},
"body": {
"error": {
"code": "<string>",
"namespace": "<string>",
"extraData": "<unknown>"
}
}
}
}{
"message": {
"header": {
"status_code": 123,
"execute_time": 123
},
"body": {
"error": {
"code": "<string>",
"namespace": "<string>",
"extraData": "<unknown>"
}
}
}
}Subscriptions
distribution.subscription.post
Grants a Musixmatch premium plan to a user when they subscribe on the distributor’s platform. The plan_id is the distributor’s plan identifier; Musixmatch maps it internally to the corresponding Musixmatch plan.
POST
/
ws
/
1.1
/
distribution.subscription.post
distribution.subscription.post
curl --request POST \
--url 'https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=' \
--header 'Content-Type: application/json' \
--data '
{
"partner_user_id": "123456",
"plan_id": "artist-plus-annual"
}
'import requests
url = "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey="
payload = {
"partner_user_id": "123456",
"plan_id": "artist-plus-annual"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({partner_user_id: '123456', plan_id: 'artist-plus-annual'})
};
fetch('https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'partner_user_id' => '123456',
'plan_id' => 'artist-plus-annual'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey="
payload := strings.NewReader("{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=")
.header("Content-Type", "application/json")
.body("{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.musixmatch.com/ws/1.1/distribution.subscription.post?apikey=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"partner_user_id\": \"123456\",\n \"plan_id\": \"artist-plus-annual\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"header": {
"status_code": 201,
"execute_time": 0.32
},
"body": {
"subscription": {
"user_id": "mxm:123456789012345678901",
"plan_id": "artist-plus-annual",
"status": "active"
}
}
}
}{
"message": {
"header": {
"status_code": 123,
"execute_time": 123
},
"body": {
"error": {
"code": "<string>",
"namespace": "<string>",
"extraData": "<unknown>"
}
}
}
}{
"message": {
"header": {
"status_code": 123,
"execute_time": 123
},
"body": {
"error": {
"code": "<string>",
"namespace": "<string>",
"extraData": "<unknown>"
}
}
}
}Authorizations
Query Parameters
The Musixmatch user ID obtained via token introspection
Body
application/json
Response
Subscription activated.
Show child attributes
Show child attributes
Was this page helpful?