URL: POST /v1/profiles
RETURN CONTENT:
{
"errors":[
{
"status":"500",
"code":"UNEXPECTED_ERROR",
"title":"An unexpected error occurred.",
"detail":"An unexpected error occurred on the server side. If this issue continues, contact us at https://developer.apple.com/contact/."
}
]
}
(I have already check the system status on https://developer.apple.com/system-status/ , API service is running)
PROGRAMING LANGUAGE: PHP
CODE:
<?php
$data = array(
'data' => array(
'attributes' => array(
'name' => $_GET['bid'],
'profileType' => 'IOS_APP_DEVELOPMENT'
),
'relationships' => array(
'bundleId' => array(
'data' => array(
'id' => $_GET['bid'],
'type' => 'bundleIds'
)
),
'certificates' => array(
'data' => array(
'id' => $_GET['cid'],
'type' => 'certificates'
)
),
// 'devices' => array(
// 'data' => array(
// 'id' => $_GET['udid'],
// 'type' => 'devices'
// )
// )
),
'type' => 'profiles'
)
);
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.appstoreconnect.apple.com/v1/profiles',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => json_encode($data),
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer '.$_GET['token']
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>