Basic auth 401 issue

Mansi Gusain 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

0 votes
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 5, 2025

Hi @Mansi Gusain 

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

Mansi Gusain 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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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 March 5, 2025

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events