6 Replies
      Latest reply on Aug 31, 2019 7:30 PM by angelbroz
      Bebe Ulrica Level 1 Level 1 (0 points)

        I am going to generate a profile but the server returns 500 and there are no hints available.

         

        I have no problem with other functions, but when I created the profile, this problem occurred. How should I solve this problem? I sent the email to the apple, but I didn't get a reply.

         

        So is the parameter error causing the server to return 500, or the Apple server has some problems?

         

        So is it a parameter error that causes the server to return 500, or is there a problem with the Apple server? Because I didn't find the relevant sample code, I was unable to determine what caused the problem.

         

        URL:https://developer.apple.com/documentation/appstoreconnectapi/create_a_profile

        POST https://api.appstoreconnect.apple.com/v1/profiles

        python code:

        def registerProfile(token, identifier, udid, certificateID):
        data = dict(
             data=dict(
                  type='profiles',
                  attributes=dict(
                         name='helloworld_ADHoc',
                         profileType='IOS_APP_ADHOC'
                  ),
                  relationships=dict(
                         bundleId=dict(
                              data=dict(
                              type='bundleIds',
                              id=identifier
                              )
                         ),
                         certificates=dict(
                              data=dict(          
                              type='certificates',
                              id=certificateID
                              )
                         ),
                         devices=dict(
                              data=dict(
                              type='devices',
                              id=udid
                         )
                    )
                  )
               )
             )
        result = requestUtils.post(token, URL.registerProfile, data)
        print(result.text)
        try:
          id = json.loads(result.content.decode())['data']['id']
        except BaseException:
          return False
        return id

        errors code

        {
        "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/."
        }]]
        }