Errors while creating an application through okta api

I am getting errors to create an app via Okta APIs. I followed Apps | Okta Developer to create an app with following:

headers = {

‘Accept’: ‘application/json’,

‘Authorization’: 'SSWS '+api_token,

‘Content-Type’: ‘application/json’
}

input = {“name”: tenant_name, “label”: “Sample tenant App”, “signOnMode”: “OPENID_CONNECT”,

}

response = requests.post(url, headers=headers, json=input)

url: https://dev-231233.oktapreview.com/api/v1/apps (example)

But I get following error:

{‘errorCode’: ‘E0000007’, ‘errorSummary’: ‘Not found: Resource not found: test-tenant (App)’, ‘errorLink’: ‘E0000007’, ‘errorId’: ‘oaedyrTOkwESTSg7_A8nXrCxg’, ‘errorCauses’: }

I am wondering that i am trying to do is create an app so why this api call is trying to find that app? Is anything missing in the request params?

I also tried the examples on POSTMAN from the same link but getting the same error {‘errorCode’: ‘E0000007’, ‘errorSummary’: ‘Not found: Resource not found: test-tenant (App)’, ‘errorLink’: ‘E0000007’, ‘errorId’: ‘oae7ASkdL_uRx-oq0nTRmk6aA’, ‘errorCauses’: } when try with following body copied from POSTMAN:

input = {
“name”: tenant_name,
“label”: tenant_name,
“signOnMode”: “OPENID_CONNECT”,
“credentials”: {
“oauthClient”: {
“token_endpoint_auth_method”: “client_secret_post”
}
},
“settings”: {
“oauthClient”: {
“client_uri”: “http://localhost:8080”,
“logo_uri”: “http://developer.okta.com/assets/images/logo-new.png”,
“redirect_uris”: [
https://example.com/oauth2/callback”,
“myapp://callback”
],
“response_types”: [
“token”,
“id_token”,
“code”
],
“grant_types”: [
“implicit”,
“authorization_code”
],
“application_type”: “native”
}
}
}

I also tried the okta python SDK but I am getting errors wrt python 3.7 . Looks like it is not maintained recently.

I would appreciate any help with code samples to create an APP ?

Double posted, see answer on SO: https://stackoverflow.com/questions/52612583/issue-while-creating-an-application-through-okta-api/52613243#52613243

@prasadjjoshi I’ll try to watch the SO post if that doesn’t help

Thanks. I will continue on the SO post

@bdemers Can you please check this error and help if there is any issue in the payload or anything else in the calling python code?
After fixing the the name field, I get this error:

{ [{‘errorSummary’: ‘Cannot create application instance. Maximum number of instances has been reached.’}]}.

However I am able to create an app from the GUI, any restrictions on API side? What is the reason for this error?

Can you please confirm asap if there are issues calling the APIs from python code as per this thread?
https://devforum.okta.com/t/python-support-feedback/1778/8

Or else I need to switch to Java or any other language?

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.