Skip to main content
Question

REST API V2 - create new private app issue

  • March 13, 2024
  • 6 replies
  • 374 views

Hi guys I need your help, I’ve created an REST API V2 token and added the relevant endpoints as described in this doc: https://docs.netskope.com/en/netskope-help/data-security/netskope-private-access/private-access-rest-apis/

after trying every combination to create a new publisher app with the Swagger UI, I get this response:

{
"message": "User Portal App cannot be created.",
"status": "error"
}

what am I doing wrong? 😤

This topic has been closed for replies.

6 replies

Forum|alt.badge.img+16
  • Netskope Employee
  • 277 replies
  • March 14, 2024

Hello @nesi10062,

 

There is a value in the final section which is 

"is_user_portal_app": true

When this is set to true I get the same error.  Please set it to false and try again.  If it’s not showing up for you it goes in the final portion of the JSON with other app settings:

 

  ],
"use_publisher_dns": true,
"clientless_access": false,
"allow_unauthenticated_cors": false,
"is_user_portal_app": false,
"trust_self_signed_certs": true
}'

 


Rohit_Bhaskar
Netskope Employee
Forum|alt.badge.img+20
  • Netskope Employee
  • 493 replies
  • March 22, 2024

Hi @nesi10062 

Hope you are doing well. I hope the answer shared by @sshiflett  helps you. Feel free to mark a answer as a “Best Answer”

 

 


  • Explorer
  • 11 replies
  • January 23, 2025

@sshiflett Could you, or someone else if would be so kind, please share full example code for creating basic private app via API?

  "allow_uri_bypass": true,
  "uribypass_header_value": "string",
  "bypass_uris": [
    "string"
  ],

 

If "allow_uri_bypass": false, could the rest be omitted?

 

 "app_option": {},

 

Should this be empty or skipped?

 

 "publisher_tags": [
   {
     "tag_name": "string"
   }


Is this needed?

 

  "publishers": [
    {
      "publisher_id": "string",
      "publisher_name": "string"
    }

 

Do I need to use both: publisher_id AND publisher_name?

Thanks in advance!

 


Forum|alt.badge.img+16
  • Netskope Employee
  • 277 replies
  • January 27, 2025

@ppp

 

You do not have to post those elements.  I just tested and the minimum you have to post is the app name, host and at least one protocol:
 

{
"app_name": "Test App",
"host": "test.com",
"protocols": [
{
"port": "80",
"type": "tcp"
}
]
}

Once posted, the backend will automatically configure some of those fields to false, null or empty such as tags:
 

"tags": [],
"trust_self_signed_certs": null,
"use_publisher_dns": null
},
"status": "success"
}


If you do post the app without Publishers or other details, you will need to manually configure these in the WebUI.  


  • Explorer
  • 11 replies
  • January 28, 2025

Hello,

thank you very much for your reply - it will certainly be helpful for many people who want to start using the REST API. However, if I wanted to add a publisher then:

  "publishers": [
    {
      "publisher_id": "string",
      "publisher_name": "string"
    }

Do I need to use both: publisher_id AND publisher_name or publisher_name is enough?

Thanks in advance!

 


Forum|alt.badge.img+16
  • Netskope Employee
  • 277 replies
  • January 28, 2025

Hello ​@ppp

Apologies for the confusion.  I tested it and  you must include at least the publisher_id.  If you provide only the name you will receive an error:

{
"message": "publisher_id field is missing for publisher",
"status": "error"
}

You can obtain the Publisher ID from the /api/v2/publishers endpoint which will return a list of all Publishers and their respective IDs.