The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Basic auth 401 issue

Mansi Gusain
Contributor
March 5, 2025

Hi I am using the following two apis- 

 

Get https://name.atlassian.net/wiki/api/v2/spaces?fields=name

Post 

 

https://name.atlassian.net/wiki/api/v2/pages

 

Now, in the postman if I am authenticating using the emailid:token type of basic auth it runs perfectly, 

but if I have to use it in an agent with a schema then I am passing it as

 

Basic <base64 encoded format> but it shows 401 how to resolve?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Marc -Devoteam-
Community Champion
March 5, 2025

Hi @Mansi Gusain 

How is you call structured in the agent, can you show the configuration?

Mansi Gusain
Contributor
March 5, 2025

Yes this is the schema- 

 

 

openapi: 3.1.0
info:
title: Custom Atlassian API
version: 1.0.0
servers:
- url: https://name.atlassian.net
description: Custom Atlassian server
paths:
/wiki/api/v2/spaces:
get:
operationId: getSpacesId
summary: Retrieve space information
description: Get the ID of a space filtered by keys.
parameters:
- in: query
name: keys
required: true
description: Keys to filter spaces by.
schema:
type: string
security:
- basicAuth: []
responses:
'200':
description: The space ID.
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The ID of the space.
/wiki/api/v2/pages:
post:
operationId: createPage
summary: Create a new page
description: Create a new page in a specified space.
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
spaceId:
type: string
description: The ID of the space.
status:
type: string
enum: [current]
description: The status of the page.
title:
type: string
description: The title of the page.
body:
type: object
properties:
representation:
type: string
enum: [storage]
description: The format of the body.
value:
type: string
description: The content of the page.
security:
- basicAuth: []
responses:
'201':
description: The page was created successfully.
components:
securitySchemes:
basicAuth:
type: http
scheme: basic

Marc -Devoteam-
Community Champion
March 5, 2025

Hi @Mansi Gusain 

No what is the configuration of you API you want to make.

The above provide info is just the default.

A simple example can be found in the documentation, https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/ 

Mansi Gusain
Contributor
March 5, 2025
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events